addrlabel.c (0dc47877a3de00ceadea0005189656ae8dc52669) | addrlabel.c (3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9) |
---|---|
1/* 2 * IPv6 Address Label subsystem 3 * for the IPv6 "Default" Source Address Selection 4 * 5 * Copyright (C)2007 USAGI/WIDE Project 6 */ 7/* 8 * Author: --- 350 unchanged lines hidden (view full) --- 359static const struct nla_policy ifal_policy[IFAL_MAX+1] = { 360 [IFAL_ADDRESS] = { .len = sizeof(struct in6_addr), }, 361 [IFAL_LABEL] = { .len = sizeof(u32), }, 362}; 363 364static int ip6addrlbl_newdel(struct sk_buff *skb, struct nlmsghdr *nlh, 365 void *arg) 366{ | 1/* 2 * IPv6 Address Label subsystem 3 * for the IPv6 "Default" Source Address Selection 4 * 5 * Copyright (C)2007 USAGI/WIDE Project 6 */ 7/* 8 * Author: --- 350 unchanged lines hidden (view full) --- 359static const struct nla_policy ifal_policy[IFAL_MAX+1] = { 360 [IFAL_ADDRESS] = { .len = sizeof(struct in6_addr), }, 361 [IFAL_LABEL] = { .len = sizeof(u32), }, 362}; 363 364static int ip6addrlbl_newdel(struct sk_buff *skb, struct nlmsghdr *nlh, 365 void *arg) 366{ |
367 struct net *net = skb->sk->sk_net; | 367 struct net *net = sock_net(skb->sk); |
368 struct ifaddrlblmsg *ifal; 369 struct nlattr *tb[IFAL_MAX+1]; 370 struct in6_addr *pfx; 371 u32 label; 372 int err = 0; 373 374 if (net != &init_net) 375 return 0; --- 71 unchanged lines hidden (view full) --- 447 return -EMSGSIZE; 448 } 449 450 return nlmsg_end(skb, nlh); 451} 452 453static int ip6addrlbl_dump(struct sk_buff *skb, struct netlink_callback *cb) 454{ | 368 struct ifaddrlblmsg *ifal; 369 struct nlattr *tb[IFAL_MAX+1]; 370 struct in6_addr *pfx; 371 u32 label; 372 int err = 0; 373 374 if (net != &init_net) 375 return 0; --- 71 unchanged lines hidden (view full) --- 447 return -EMSGSIZE; 448 } 449 450 return nlmsg_end(skb, nlh); 451} 452 453static int ip6addrlbl_dump(struct sk_buff *skb, struct netlink_callback *cb) 454{ |
455 struct net *net = skb->sk->sk_net; | 455 struct net *net = sock_net(skb->sk); |
456 struct ip6addrlbl_entry *p; 457 struct hlist_node *pos; 458 int idx = 0, s_idx = cb->args[0]; 459 int err; 460 461 if (net != &init_net) 462 return 0; 463 --- 21 unchanged lines hidden (view full) --- 485 + nla_total_size(16) /* IFAL_ADDRESS */ 486 + nla_total_size(4) /* IFAL_LABEL */ 487 ); 488} 489 490static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh, 491 void *arg) 492{ | 456 struct ip6addrlbl_entry *p; 457 struct hlist_node *pos; 458 int idx = 0, s_idx = cb->args[0]; 459 int err; 460 461 if (net != &init_net) 462 return 0; 463 --- 21 unchanged lines hidden (view full) --- 485 + nla_total_size(16) /* IFAL_ADDRESS */ 486 + nla_total_size(4) /* IFAL_LABEL */ 487 ); 488} 489 490static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh, 491 void *arg) 492{ |
493 struct net *net = in_skb->sk->sk_net; | 493 struct net *net = sock_net(in_skb->sk); |
494 struct ifaddrlblmsg *ifal; 495 struct nlattr *tb[IFAL_MAX+1]; 496 struct in6_addr *addr; 497 u32 lseq; 498 int err = 0; 499 struct ip6addrlbl_entry *p; 500 struct sk_buff *skb; 501 --- 65 unchanged lines hidden --- | 494 struct ifaddrlblmsg *ifal; 495 struct nlattr *tb[IFAL_MAX+1]; 496 struct in6_addr *addr; 497 u32 lseq; 498 int err = 0; 499 struct ip6addrlbl_entry *p; 500 struct sk_buff *skb; 501 --- 65 unchanged lines hidden --- |