aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-02 20:53:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-02 20:53:39 -0400
commited359a3b7b6ade0071f378c0cf4392d252f7d334 (patch)
tree8f81e03fcb44a7d36f53bc5a53d8eced7154bee2 /net/ipv6
parent95694129b43165911dc4e8a972f0d39ad98d86be (diff)
parent2240eb4ae3dc4acff20d1a8947c441c451513e37 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Provide device string properly for USB i2400m wimax devices, also don't OOPS when providing firmware string. From Phil Sutter. 2) Add support for sh_eth SH7734 chips, from Nobuhiro Iwamatsu. 3) Add another device ID to USB zaurus driver, from Guan Xin. 4) Loop index start in pool vector iterator is wrong causing MAC to not get configured in bnx2x driver, fix from Dmitry Kravkov. 5) EQL driver assumes HZ=100, fix from Eric Dumazet. 6) Now that skb_add_rx_frag() can specify the truesize increment separately, do so in f_phonet and cdc_phonet, also from Eric Dumazet. 7) virtio_net accidently uses net_ratelimit() not only on the kernel warning but also the statistic bump, fix from Rick Jones. 8) ip_route_input_mc() uses fixed init_net namespace, oops, use dev_net(dev) instead. Fix from Benjamin LaHaise. 9) dev_forward_skb() needs to clear the incoming interface index of the SKB so that it looks like a new incoming packet, also from Benjamin LaHaise. 10) iwlwifi mistakenly initializes a channel entry as 2GHZ instead of 5GHZ, fix from Stanislav Yakovlev. 11) Missing kmalloc() return value checks in orinoco, from Santosh Nayak. 12) ath9k doesn't check for HT capabilities in the right way, it is checking ht_supported instead of the ATH9K_HW_CAP_HT flag. Fix from Sujith Manoharan. 13) Fix x86 BPF JIT emission of 16-bit immediate field of AND instructions, from Feiran Zhuang. 14) Avoid infinite loop in GARP code when registering sysfs entries. From David Ward. 15) rose protocol uses memcpy instead of memcmp in a device address comparison, oops. Fix from Daniel Borkmann. 16) Fix build of lpc_eth due to dev_hw_addr_rancom() interface being renamed to eth_hw_addr_random(). From Roland Stigge. 17) Make ipv6 RTM_GETROUTE interpret RTA_IIF attribute the same way that ipv4 does. Fix from Shmulik Ladkani. 18) via-rhine has an inverted bit test, causing suspend/resume regressions. Fix from Andreas Mohr. 19) RIONET assumes 4K page size, fix from Akinobu Mita. 20) Initialization of imask register in sky2 is buggy, because bits are "or'd" into an uninitialized local variable. Fix from Lino Sanfilippo. 21) Fix FCOE checksum offload handling, from Yi Zou. 22) Fix VLAN processing regression in e1000, from Jiri Pirko. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits) sky2: dont overwrite settings for PHY Quick link tg3: Fix 5717 serdes powerdown problem net: usb: cdc_eem: fix mtu net: sh_eth: fix endian check for architecture independent usb/rtl8150 : Remove duplicated definitions rionet: fix page allocation order of rionet_active via-rhine: fix wait-bit inversion. ipv6: Fix RTM_GETROUTE's interpretation of RTA_IIF to be consistent with ipv4 net: lpc_eth: Fix rename of dev_hw_addr_random net/netfilter/nfnetlink_acct.c: use linux/atomic.h rose_dev: fix memcpy-bug in rose_set_mac_address Fix non TBI PHY access; a bad merge undid bug fix in a previous commit. net/garp: avoid infinite loop if attribute already exists x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND bonding: emit event when bonding changes MAC mac80211: fix oper channel timestamp updation ath9k: Use HW HT capabilites properly MAINTAINERS: adding maintainer for ipw2x00 net: orinoco: add error handling for failed kmalloc(). net/wireless: ipw2x00: fix a typo in wiphy struct initilization ...
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/route.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 496b62712fe8..3992e26a6039 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -881,6 +881,16 @@ static struct rt6_info *ip6_pol_route_input(struct net *net, struct fib6_table *
881 return ip6_pol_route(net, table, fl6->flowi6_iif, fl6, flags); 881 return ip6_pol_route(net, table, fl6->flowi6_iif, fl6, flags);
882} 882}
883 883
884static struct dst_entry *ip6_route_input_lookup(struct net *net,
885 struct net_device *dev,
886 struct flowi6 *fl6, int flags)
887{
888 if (rt6_need_strict(&fl6->daddr) && dev->type != ARPHRD_PIMREG)
889 flags |= RT6_LOOKUP_F_IFACE;
890
891 return fib6_rule_lookup(net, fl6, flags, ip6_pol_route_input);
892}
893
884void ip6_route_input(struct sk_buff *skb) 894void ip6_route_input(struct sk_buff *skb)
885{ 895{
886 const struct ipv6hdr *iph = ipv6_hdr(skb); 896 const struct ipv6hdr *iph = ipv6_hdr(skb);
@@ -895,10 +905,7 @@ void ip6_route_input(struct sk_buff *skb)
895 .flowi6_proto = iph->nexthdr, 905 .flowi6_proto = iph->nexthdr,
896 }; 906 };
897 907
898 if (rt6_need_strict(&iph->daddr) && skb->dev->type != ARPHRD_PIMREG) 908 skb_dst_set(skb, ip6_route_input_lookup(net, skb->dev, &fl6, flags));
899 flags |= RT6_LOOKUP_F_IFACE;
900
901 skb_dst_set(skb, fib6_rule_lookup(net, &fl6, flags, ip6_pol_route_input));
902} 909}
903 910
904static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table, 911static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table,
@@ -2537,7 +2544,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2537 struct sk_buff *skb; 2544 struct sk_buff *skb;
2538 struct rtmsg *rtm; 2545 struct rtmsg *rtm;
2539 struct flowi6 fl6; 2546 struct flowi6 fl6;
2540 int err, iif = 0; 2547 int err, iif = 0, oif = 0;
2541 2548
2542 err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy); 2549 err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy);
2543 if (err < 0) 2550 if (err < 0)
@@ -2564,15 +2571,29 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2564 iif = nla_get_u32(tb[RTA_IIF]); 2571 iif = nla_get_u32(tb[RTA_IIF]);
2565 2572
2566 if (tb[RTA_OIF]) 2573 if (tb[RTA_OIF])
2567 fl6.flowi6_oif = nla_get_u32(tb[RTA_OIF]); 2574 oif = nla_get_u32(tb[RTA_OIF]);
2568 2575
2569 if (iif) { 2576 if (iif) {
2570 struct net_device *dev; 2577 struct net_device *dev;
2578 int flags = 0;
2579
2571 dev = __dev_get_by_index(net, iif); 2580 dev = __dev_get_by_index(net, iif);
2572 if (!dev) { 2581 if (!dev) {
2573 err = -ENODEV; 2582 err = -ENODEV;
2574 goto errout; 2583 goto errout;
2575 } 2584 }
2585
2586 fl6.flowi6_iif = iif;
2587
2588 if (!ipv6_addr_any(&fl6.saddr))
2589 flags |= RT6_LOOKUP_F_HAS_SADDR;
2590
2591 rt = (struct rt6_info *)ip6_route_input_lookup(net, dev, &fl6,
2592 flags);
2593 } else {
2594 fl6.flowi6_oif = oif;
2595
2596 rt = (struct rt6_info *)ip6_route_output(net, NULL, &fl6);
2576 } 2597 }
2577 2598
2578 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 2599 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
@@ -2587,7 +2608,6 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2587 skb_reset_mac_header(skb); 2608 skb_reset_mac_header(skb);
2588 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); 2609 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr));
2589 2610
2590 rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl6);
2591 skb_dst_set(skb, &rt->dst); 2611 skb_dst_set(skb, &rt->dst);
2592 2612
2593 err = rt6_fill_node(net, skb, rt, &fl6.daddr, &fl6.saddr, iif, 2613 err = rt6_fill_node(net, skb, rt, &fl6.daddr, &fl6.saddr, iif,