diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-08-04 09:14:38 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-08-04 09:14:38 -0400 |
commit | d790d4d583aeaed9fc6f8a9f4d9f8ce6b1c15c7f (patch) | |
tree | 854ab394486288d40fa8179cbfaf66e8bdc44b0f /net/ipv6 | |
parent | 73b2c7165b76b20eb1290e7efebc33cfd21db1ca (diff) | |
parent | 3a09b1be53d23df780a0cd0e4087a05e2ca4a00c (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 14 | ||||
-rw-r--r-- | net/ipv6/mip6.c | 3 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_REJECT.c | 6 | ||||
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 2 |
5 files changed, 18 insertions, 9 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e1a698df5706..784f34d11fdd 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1760,7 +1760,10 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev) | |||
1760 | 1760 | ||
1761 | idev = ipv6_find_idev(dev); | 1761 | idev = ipv6_find_idev(dev); |
1762 | if (!idev) | 1762 | if (!idev) |
1763 | return NULL; | 1763 | return ERR_PTR(-ENOBUFS); |
1764 | |||
1765 | if (idev->cnf.disable_ipv6) | ||
1766 | return ERR_PTR(-EACCES); | ||
1764 | 1767 | ||
1765 | /* Add default multicast route */ | 1768 | /* Add default multicast route */ |
1766 | addrconf_add_mroute(dev); | 1769 | addrconf_add_mroute(dev); |
@@ -2129,8 +2132,9 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx, | |||
2129 | if (!dev) | 2132 | if (!dev) |
2130 | return -ENODEV; | 2133 | return -ENODEV; |
2131 | 2134 | ||
2132 | if ((idev = addrconf_add_dev(dev)) == NULL) | 2135 | idev = addrconf_add_dev(dev); |
2133 | return -ENOBUFS; | 2136 | if (IS_ERR(idev)) |
2137 | return PTR_ERR(idev); | ||
2134 | 2138 | ||
2135 | scope = ipv6_addr_scope(pfx); | 2139 | scope = ipv6_addr_scope(pfx); |
2136 | 2140 | ||
@@ -2377,7 +2381,7 @@ static void addrconf_dev_config(struct net_device *dev) | |||
2377 | } | 2381 | } |
2378 | 2382 | ||
2379 | idev = addrconf_add_dev(dev); | 2383 | idev = addrconf_add_dev(dev); |
2380 | if (idev == NULL) | 2384 | if (IS_ERR(idev)) |
2381 | return; | 2385 | return; |
2382 | 2386 | ||
2383 | memset(&addr, 0, sizeof(struct in6_addr)); | 2387 | memset(&addr, 0, sizeof(struct in6_addr)); |
@@ -2468,7 +2472,7 @@ static void addrconf_ip6_tnl_config(struct net_device *dev) | |||
2468 | ASSERT_RTNL(); | 2472 | ASSERT_RTNL(); |
2469 | 2473 | ||
2470 | idev = addrconf_add_dev(dev); | 2474 | idev = addrconf_add_dev(dev); |
2471 | if (!idev) { | 2475 | if (IS_ERR(idev)) { |
2472 | printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); | 2476 | printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); |
2473 | return; | 2477 | return; |
2474 | } | 2478 | } |
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c index 2794b6002836..d6e9599d0705 100644 --- a/net/ipv6/mip6.c +++ b/net/ipv6/mip6.c | |||
@@ -347,11 +347,12 @@ static const struct xfrm_type mip6_destopt_type = | |||
347 | 347 | ||
348 | static int mip6_rthdr_input(struct xfrm_state *x, struct sk_buff *skb) | 348 | static int mip6_rthdr_input(struct xfrm_state *x, struct sk_buff *skb) |
349 | { | 349 | { |
350 | struct ipv6hdr *iph = ipv6_hdr(skb); | ||
350 | struct rt2_hdr *rt2 = (struct rt2_hdr *)skb->data; | 351 | struct rt2_hdr *rt2 = (struct rt2_hdr *)skb->data; |
351 | int err = rt2->rt_hdr.nexthdr; | 352 | int err = rt2->rt_hdr.nexthdr; |
352 | 353 | ||
353 | spin_lock(&x->lock); | 354 | spin_lock(&x->lock); |
354 | if (!ipv6_addr_equal(&rt2->addr, (struct in6_addr *)x->coaddr) && | 355 | if (!ipv6_addr_equal(&iph->daddr, (struct in6_addr *)x->coaddr) && |
355 | !ipv6_addr_any((struct in6_addr *)x->coaddr)) | 356 | !ipv6_addr_any((struct in6_addr *)x->coaddr)) |
356 | err = -ENOENT; | 357 | err = -ENOENT; |
357 | spin_unlock(&x->lock); | 358 | spin_unlock(&x->lock); |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 0abdc242ddb7..2efef52fb461 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -586,6 +586,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, | |||
586 | src_addr = solicited_addr; | 586 | src_addr = solicited_addr; |
587 | if (ifp->flags & IFA_F_OPTIMISTIC) | 587 | if (ifp->flags & IFA_F_OPTIMISTIC) |
588 | override = 0; | 588 | override = 0; |
589 | inc_opt |= ifp->idev->cnf.force_tllao; | ||
589 | in6_ifa_put(ifp); | 590 | in6_ifa_put(ifp); |
590 | } else { | 591 | } else { |
591 | if (ipv6_dev_get_saddr(dev_net(dev), dev, daddr, | 592 | if (ipv6_dev_get_saddr(dev_net(dev), dev, daddr, |
@@ -599,7 +600,6 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, | |||
599 | icmp6h.icmp6_solicited = solicited; | 600 | icmp6h.icmp6_solicited = solicited; |
600 | icmp6h.icmp6_override = override; | 601 | icmp6h.icmp6_override = override; |
601 | 602 | ||
602 | inc_opt |= ifp->idev->cnf.force_tllao; | ||
603 | __ndisc_send(dev, neigh, daddr, src_addr, | 603 | __ndisc_send(dev, neigh, daddr, src_addr, |
604 | &icmp6h, solicited_addr, | 604 | &icmp6h, solicited_addr, |
605 | inc_opt ? ND_OPT_TARGET_LL_ADDR : 0); | 605 | inc_opt ? ND_OPT_TARGET_LL_ADDR : 0); |
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c index 47d227713758..2933396e0281 100644 --- a/net/ipv6/netfilter/ip6t_REJECT.c +++ b/net/ipv6/netfilter/ip6t_REJECT.c | |||
@@ -97,9 +97,11 @@ static void send_reset(struct net *net, struct sk_buff *oldskb) | |||
97 | fl.fl_ip_dport = otcph.source; | 97 | fl.fl_ip_dport = otcph.source; |
98 | security_skb_classify_flow(oldskb, &fl); | 98 | security_skb_classify_flow(oldskb, &fl); |
99 | dst = ip6_route_output(net, NULL, &fl); | 99 | dst = ip6_route_output(net, NULL, &fl); |
100 | if (dst == NULL) | 100 | if (dst == NULL || dst->error) { |
101 | dst_release(dst); | ||
101 | return; | 102 | return; |
102 | if (dst->error || xfrm_lookup(net, &dst, &fl, NULL, 0)) | 103 | } |
104 | if (xfrm_lookup(net, &dst, &fl, NULL, 0)) | ||
103 | return; | 105 | return; |
104 | 106 | ||
105 | hh_len = (dst->dev->hard_header_len + 15)&~15; | 107 | hh_len = (dst->dev->hard_header_len + 15)&~15; |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 4a0e77e14468..6baeabbbca82 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -124,6 +124,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse) | |||
124 | u8 nexthdr = nh[IP6CB(skb)->nhoff]; | 124 | u8 nexthdr = nh[IP6CB(skb)->nhoff]; |
125 | 125 | ||
126 | memset(fl, 0, sizeof(struct flowi)); | 126 | memset(fl, 0, sizeof(struct flowi)); |
127 | fl->mark = skb->mark; | ||
128 | |||
127 | ipv6_addr_copy(&fl->fl6_dst, reverse ? &hdr->saddr : &hdr->daddr); | 129 | ipv6_addr_copy(&fl->fl6_dst, reverse ? &hdr->saddr : &hdr->daddr); |
128 | ipv6_addr_copy(&fl->fl6_src, reverse ? &hdr->daddr : &hdr->saddr); | 130 | ipv6_addr_copy(&fl->fl6_src, reverse ? &hdr->daddr : &hdr->saddr); |
129 | 131 | ||