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

Configure Feed

Select the types of activity you want to include in your feed.

net: ipv4: ipmr: ipmr_queue_xmit(): Drop local variable `dev'

The variable is used for caching of rt->dst.dev. The netdevice referenced
therein does not change during the scope of validity of that local. At the
same time, the local is only used twice, and each of these uses will end up
in a different function in the following patches, further eliminating any
use the local could have had.

Drop the local altogether and inline the uses.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/c80600a4b51679fe78f429ccb6d60892c2f9e4de.1750113335.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Petr Machata and committed by
Jakub Kicinski
3b7bc938 e3411e32

+2 -5
+2 -5
net/ipv4/ipmr.c
··· 1859 1859 const struct iphdr *iph = ip_hdr(skb); 1860 1860 struct vif_device *vif = &mrt->vif_table[vifi]; 1861 1861 struct net_device *vif_dev; 1862 - struct net_device *dev; 1863 1862 struct rtable *rt; 1864 1863 struct flowi4 fl4; 1865 1864 int encap = 0; ··· 1897 1898 goto out_free; 1898 1899 } 1899 1900 1900 - dev = rt->dst.dev; 1901 - 1902 1901 if (skb->len+encap > dst_mtu(&rt->dst) && (ntohs(iph->frag_off) & IP_DF)) { 1903 1902 /* Do not fragment multicasts. Alas, IPv4 does not 1904 1903 * allow to send ICMP, so that packets will disappear ··· 1907 1910 goto out_free; 1908 1911 } 1909 1912 1910 - encap += LL_RESERVED_SPACE(dev) + rt->dst.header_len; 1913 + encap += LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len; 1911 1914 1912 1915 if (skb_cow(skb, encap)) { 1913 1916 ip_rt_put(rt); ··· 1944 1947 * result in receiving multiple packets. 1945 1948 */ 1946 1949 NF_HOOK(NFPROTO_IPV4, NF_INET_FORWARD, 1947 - net, NULL, skb, skb->dev, dev, 1950 + net, NULL, skb, skb->dev, rt->dst.dev, 1948 1951 ipmr_forward_finish); 1949 1952 return; 1950 1953