Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: l3mdev: remove redundant calls

A previous patch added l3mdev flow update making these hooks
redundant. Remove them.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Ahern and committed by
David S. Miller
e0d56fdd 4c1feac5

+10 -37
+1 -2
net/ipv4/ip_output.c
··· 1582 1582 } 1583 1583 1584 1584 oif = arg->bound_dev_if; 1585 - if (!oif && netif_index_is_l3_master(net, skb->skb_iif)) 1586 - oif = skb->skb_iif; 1585 + oif = oif ? : skb->skb_iif; 1587 1586 1588 1587 flowi4_init_output(&fl4, oif, 1589 1588 IP4_REPLY_MARK(net, skb->mark),
+2 -10
net/ipv4/route.c
··· 1831 1831 * Now we are ready to route packet. 1832 1832 */ 1833 1833 fl4.flowi4_oif = 0; 1834 - fl4.flowi4_iif = l3mdev_fib_oif_rcu(dev); 1834 + fl4.flowi4_iif = dev->ifindex; 1835 1835 fl4.flowi4_mark = skb->mark; 1836 1836 fl4.flowi4_tos = tos; 1837 1837 fl4.flowi4_scope = RT_SCOPE_UNIVERSE; ··· 2150 2150 unsigned int flags = 0; 2151 2151 struct fib_result res; 2152 2152 struct rtable *rth; 2153 - int master_idx; 2154 2153 int orig_oif; 2155 2154 int err = -ENETUNREACH; 2156 2155 ··· 2159 2160 2160 2161 orig_oif = fl4->flowi4_oif; 2161 2162 2162 - master_idx = l3mdev_master_ifindex_by_index(net, fl4->flowi4_oif); 2163 - if (master_idx) 2164 - fl4->flowi4_oif = master_idx; 2165 2163 fl4->flowi4_iif = LOOPBACK_IFINDEX; 2166 2164 fl4->flowi4_tos = tos & IPTOS_RT_MASK; 2167 2165 fl4->flowi4_scope = ((tos & RTO_ONLINK) ? ··· 2259 2263 if (err) { 2260 2264 res.fi = NULL; 2261 2265 res.table = NULL; 2262 - if (fl4->flowi4_oif && 2263 - !netif_index_is_l3_master(net, fl4->flowi4_oif)) { 2266 + if (fl4->flowi4_oif) { 2264 2267 /* Apparently, routing tables are wrong. Assume, 2265 2268 that the destination is on link. 2266 2269 ··· 2571 2576 fl4.flowi4_tos = rtm->rtm_tos; 2572 2577 fl4.flowi4_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0; 2573 2578 fl4.flowi4_mark = mark; 2574 - 2575 - if (netif_index_is_l3_master(net, fl4.flowi4_oif)) 2576 - fl4.flowi4_flags = FLOWI_FLAG_L3MDEV_SRC | FLOWI_FLAG_SKIP_NH_OIF; 2577 2579 2578 2580 if (iif) { 2579 2581 struct net_device *dev;
+1 -1
net/ipv4/xfrm4_policy.c
··· 112 112 int oif = 0; 113 113 114 114 if (skb_dst(skb)) 115 - oif = l3mdev_fib_oif(skb_dst(skb)->dev); 115 + oif = skb_dst(skb)->dev->ifindex; 116 116 117 117 memset(fl4, 0, sizeof(struct flowi4)); 118 118 fl4->flowi4_mark = skb->mark;
-2
net/ipv6/ip6_output.c
··· 1070 1070 return ERR_PTR(err); 1071 1071 if (final_dst) 1072 1072 fl6->daddr = *final_dst; 1073 - if (!fl6->flowi6_oif) 1074 - fl6->flowi6_oif = l3mdev_fib_oif(dst->dev); 1075 1073 1076 1074 return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); 1077 1075 }
+2 -9
net/ipv6/ndisc.c
··· 67 67 #include <net/flow.h> 68 68 #include <net/ip6_checksum.h> 69 69 #include <net/inet_common.h> 70 - #include <net/l3mdev.h> 71 70 #include <linux/proc_fs.h> 72 71 73 72 #include <linux/netfilter.h> ··· 456 457 457 458 if (!dst) { 458 459 struct flowi6 fl6; 459 - int oif = l3mdev_fib_oif(skb->dev); 460 + int oif = skb->dev->ifindex; 460 461 461 462 icmpv6_flow_init(sk, &fl6, type, saddr, daddr, oif); 462 - if (oif != skb->dev->ifindex) 463 - fl6.flowi6_flags |= FLOWI_FLAG_L3MDEV_SRC; 464 463 dst = icmp6_dst_alloc(skb->dev, &fl6); 465 464 if (IS_ERR(dst)) { 466 465 kfree_skb(skb); ··· 1535 1538 int rd_len; 1536 1539 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL, 1537 1540 ops_data_buf[NDISC_OPS_REDIRECT_DATA_SPACE], *ops_data = NULL; 1538 - int oif = l3mdev_fib_oif(dev); 1539 1541 bool ret; 1540 1542 1541 1543 if (ipv6_get_lladdr(dev, &saddr_buf, IFA_F_TENTATIVE)) { ··· 1551 1555 } 1552 1556 1553 1557 icmpv6_flow_init(sk, &fl6, NDISC_REDIRECT, 1554 - &saddr_buf, &ipv6_hdr(skb)->saddr, oif); 1555 - 1556 - if (oif != skb->dev->ifindex) 1557 - fl6.flowi6_flags |= FLOWI_FLAG_L3MDEV_SRC; 1558 + &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex); 1558 1559 1559 1560 dst = ip6_route_output(net, NULL, &fl6); 1560 1561 if (dst->error) {
+1 -6
net/ipv6/route.c
··· 1164 1164 int flags = RT6_LOOKUP_F_HAS_SADDR; 1165 1165 struct ip_tunnel_info *tun_info; 1166 1166 struct flowi6 fl6 = { 1167 - .flowi6_iif = l3mdev_fib_oif(skb->dev), 1167 + .flowi6_iif = skb->dev->ifindex, 1168 1168 .daddr = iph->daddr, 1169 1169 .saddr = iph->saddr, 1170 1170 .flowlabel = ip6_flowinfo(iph), ··· 3348 3348 flags); 3349 3349 } else { 3350 3350 fl6.flowi6_oif = oif; 3351 - 3352 - if (netif_index_is_l3_master(net, oif)) { 3353 - fl6.flowi6_flags = FLOWI_FLAG_L3MDEV_SRC | 3354 - FLOWI_FLAG_SKIP_NH_OIF; 3355 - } 3356 3351 3357 3352 rt = (struct rt6_info *)ip6_route_output(net, NULL, &fl6); 3358 3353 }
+2 -6
net/ipv6/tcp_ipv6.c
··· 818 818 fl6.flowi6_proto = IPPROTO_TCP; 819 819 if (rt6_need_strict(&fl6.daddr) && !oif) 820 820 fl6.flowi6_oif = tcp_v6_iif(skb); 821 - else { 822 - if (!oif && netif_index_is_l3_master(net, skb->skb_iif)) 823 - oif = skb->skb_iif; 824 - 825 - fl6.flowi6_oif = oif; 826 - } 821 + else 822 + fl6.flowi6_oif = oif ? : skb->skb_iif; 827 823 828 824 fl6.flowi6_mark = IP6_REPLY_MARK(net, skb->mark); 829 825 fl6.fl6_dport = t1->dest;
+1 -1
net/ipv6/xfrm6_policy.c
··· 134 134 nexthdr = nh[nhoff]; 135 135 136 136 if (skb_dst(skb)) 137 - oif = l3mdev_fib_oif(skb_dst(skb)->dev); 137 + oif = skb_dst(skb)->dev->ifindex; 138 138 139 139 memset(fl6, 0, sizeof(struct flowi6)); 140 140 fl6->flowi6_mark = skb->mark;