diff options
Diffstat (limited to 'net/ipv6')
| -rw-r--r-- | net/ipv6/exthdrs.c | 7 | ||||
| -rw-r--r-- | net/ipv6/ip6_output.c | 3 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 4 | ||||
| -rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 1 | ||||
| -rw-r--r-- | net/ipv6/xfrm6_policy.c | 25 |
5 files changed, 24 insertions, 16 deletions
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index df159fffe4b..4bac362b133 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
| @@ -559,6 +559,11 @@ static inline struct inet6_dev *ipv6_skb_idev(struct sk_buff *skb) | |||
| 559 | return skb_dst(skb) ? ip6_dst_idev(skb_dst(skb)) : __in6_dev_get(skb->dev); | 559 | return skb_dst(skb) ? ip6_dst_idev(skb_dst(skb)) : __in6_dev_get(skb->dev); |
| 560 | } | 560 | } |
| 561 | 561 | ||
| 562 | static inline struct net *ipv6_skb_net(struct sk_buff *skb) | ||
| 563 | { | ||
| 564 | return skb_dst(skb) ? dev_net(skb_dst(skb)->dev) : dev_net(skb->dev); | ||
| 565 | } | ||
| 566 | |||
| 562 | /* Router Alert as of RFC 2711 */ | 567 | /* Router Alert as of RFC 2711 */ |
| 563 | 568 | ||
| 564 | static int ipv6_hop_ra(struct sk_buff *skb, int optoff) | 569 | static int ipv6_hop_ra(struct sk_buff *skb, int optoff) |
| @@ -580,8 +585,8 @@ static int ipv6_hop_ra(struct sk_buff *skb, int optoff) | |||
| 580 | static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff) | 585 | static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff) |
| 581 | { | 586 | { |
| 582 | const unsigned char *nh = skb_network_header(skb); | 587 | const unsigned char *nh = skb_network_header(skb); |
| 588 | struct net *net = ipv6_skb_net(skb); | ||
| 583 | u32 pkt_len; | 589 | u32 pkt_len; |
| 584 | struct net *net = dev_net(skb_dst(skb)->dev); | ||
| 585 | 590 | ||
| 586 | if (nh[optoff + 1] != 4 || (optoff & 3) != 2) { | 591 | if (nh[optoff + 1] != 4 || (optoff & 3) != 2) { |
| 587 | LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", | 592 | LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index cd48801a8d6..eb6d0972863 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
| @@ -121,10 +121,9 @@ static int ip6_output2(struct sk_buff *skb) | |||
| 121 | skb->dev = dev; | 121 | skb->dev = dev; |
| 122 | 122 | ||
| 123 | if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr)) { | 123 | if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr)) { |
| 124 | struct ipv6_pinfo* np = skb->sk ? inet6_sk(skb->sk) : NULL; | ||
| 125 | struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); | 124 | struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); |
| 126 | 125 | ||
| 127 | if (!(dev->flags & IFF_LOOPBACK) && (!np || np->mc_loop) && | 126 | if (!(dev->flags & IFF_LOOPBACK) && sk_mc_loop(skb->sk) && |
| 128 | ((mroute6_socket(dev_net(dev)) && | 127 | ((mroute6_socket(dev_net(dev)) && |
| 129 | !(IP6CB(skb)->flags & IP6SKB_FORWARDED)) || | 128 | !(IP6CB(skb)->flags & IP6SKB_FORWARDED)) || |
| 130 | ipv6_chk_mcast_addr(dev, &ipv6_hdr(skb)->daddr, | 129 | ipv6_chk_mcast_addr(dev, &ipv6_hdr(skb)->daddr, |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 480d7f8c980..8a7e0f52e17 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
| @@ -1164,10 +1164,10 @@ static int get_info(struct net *net, void __user *user, int *len, int compat) | |||
| 1164 | if (t && !IS_ERR(t)) { | 1164 | if (t && !IS_ERR(t)) { |
| 1165 | struct ip6t_getinfo info; | 1165 | struct ip6t_getinfo info; |
| 1166 | const struct xt_table_info *private = t->private; | 1166 | const struct xt_table_info *private = t->private; |
| 1167 | |||
| 1168 | #ifdef CONFIG_COMPAT | 1167 | #ifdef CONFIG_COMPAT |
| 1168 | struct xt_table_info tmp; | ||
| 1169 | |||
| 1169 | if (compat) { | 1170 | if (compat) { |
| 1170 | struct xt_table_info tmp; | ||
| 1171 | ret = compat_table_info(private, &tmp); | 1171 | ret = compat_table_info(private, &tmp); |
| 1172 | xt_compat_flush_offsets(AF_INET6); | 1172 | xt_compat_flush_offsets(AF_INET6); |
| 1173 | private = &tmp; | 1173 | private = &tmp; |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 312c20adc83..624a54832a7 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
| @@ -63,6 +63,7 @@ struct nf_ct_frag6_queue | |||
| 63 | struct inet_frag_queue q; | 63 | struct inet_frag_queue q; |
| 64 | 64 | ||
| 65 | __be32 id; /* fragment id */ | 65 | __be32 id; /* fragment id */ |
| 66 | u32 user; | ||
| 66 | struct in6_addr saddr; | 67 | struct in6_addr saddr; |
| 67 | struct in6_addr daddr; | 68 | struct in6_addr daddr; |
| 68 | 69 | ||
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 7254e3f899a..dbdc696f5fc 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #include <net/mip6.h> | 24 | #include <net/mip6.h> |
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | static struct dst_ops xfrm6_dst_ops; | ||
| 28 | static struct xfrm_policy_afinfo xfrm6_policy_afinfo; | 27 | static struct xfrm_policy_afinfo xfrm6_policy_afinfo; |
| 29 | 28 | ||
| 30 | static struct dst_entry *xfrm6_dst_lookup(struct net *net, int tos, | 29 | static struct dst_entry *xfrm6_dst_lookup(struct net *net, int tos, |
| @@ -224,8 +223,10 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse) | |||
| 224 | 223 | ||
| 225 | static inline int xfrm6_garbage_collect(struct dst_ops *ops) | 224 | static inline int xfrm6_garbage_collect(struct dst_ops *ops) |
| 226 | { | 225 | { |
| 227 | xfrm6_policy_afinfo.garbage_collect(&init_net); | 226 | struct net *net = container_of(ops, struct net, xfrm.xfrm6_dst_ops); |
| 228 | return (atomic_read(&xfrm6_dst_ops.entries) > xfrm6_dst_ops.gc_thresh*2); | 227 | |
| 228 | xfrm6_policy_afinfo.garbage_collect(net); | ||
| 229 | return (atomic_read(&ops->entries) > ops->gc_thresh * 2); | ||
| 229 | } | 230 | } |
| 230 | 231 | ||
| 231 | static void xfrm6_update_pmtu(struct dst_entry *dst, u32 mtu) | 232 | static void xfrm6_update_pmtu(struct dst_entry *dst, u32 mtu) |
| @@ -310,7 +311,7 @@ static void xfrm6_policy_fini(void) | |||
| 310 | static struct ctl_table xfrm6_policy_table[] = { | 311 | static struct ctl_table xfrm6_policy_table[] = { |
| 311 | { | 312 | { |
| 312 | .procname = "xfrm6_gc_thresh", | 313 | .procname = "xfrm6_gc_thresh", |
| 313 | .data = &xfrm6_dst_ops.gc_thresh, | 314 | .data = &init_net.xfrm.xfrm6_dst_ops.gc_thresh, |
| 314 | .maxlen = sizeof(int), | 315 | .maxlen = sizeof(int), |
| 315 | .mode = 0644, | 316 | .mode = 0644, |
| 316 | .proc_handler = proc_dointvec, | 317 | .proc_handler = proc_dointvec, |
| @@ -326,13 +327,6 @@ int __init xfrm6_init(void) | |||
| 326 | int ret; | 327 | int ret; |
| 327 | unsigned int gc_thresh; | 328 | unsigned int gc_thresh; |
| 328 | 329 | ||
| 329 | ret = xfrm6_policy_init(); | ||
| 330 | if (ret) | ||
| 331 | goto out; | ||
| 332 | |||
| 333 | ret = xfrm6_state_init(); | ||
| 334 | if (ret) | ||
| 335 | goto out_policy; | ||
| 336 | /* | 330 | /* |
| 337 | * We need a good default value for the xfrm6 gc threshold. | 331 | * We need a good default value for the xfrm6 gc threshold. |
| 338 | * In ipv4 we set it to the route hash table size * 8, which | 332 | * In ipv4 we set it to the route hash table size * 8, which |
| @@ -346,6 +340,15 @@ int __init xfrm6_init(void) | |||
| 346 | */ | 340 | */ |
| 347 | gc_thresh = FIB6_TABLE_HASHSZ * 8; | 341 | gc_thresh = FIB6_TABLE_HASHSZ * 8; |
| 348 | xfrm6_dst_ops.gc_thresh = (gc_thresh < 1024) ? 1024 : gc_thresh; | 342 | xfrm6_dst_ops.gc_thresh = (gc_thresh < 1024) ? 1024 : gc_thresh; |
| 343 | |||
| 344 | ret = xfrm6_policy_init(); | ||
| 345 | if (ret) | ||
| 346 | goto out; | ||
| 347 | |||
| 348 | ret = xfrm6_state_init(); | ||
| 349 | if (ret) | ||
| 350 | goto out_policy; | ||
| 351 | |||
| 349 | #ifdef CONFIG_SYSCTL | 352 | #ifdef CONFIG_SYSCTL |
| 350 | sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, | 353 | sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, |
| 351 | xfrm6_policy_table); | 354 | xfrm6_policy_table); |
