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

ipv6: Initial skb->dev and skb->protocol in ip6_output

Move the initialization of skb->dev and skb->protocol from
ip6_finish_output2 to ip6_output. This can make the skb->dev and
skb->protocol information avalaible to the CGROUP eBPF filter.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Chenbo Feng and committed by
David S. Miller
97a7a37a d86cc04e

+3 -3
+3 -3
net/ipv6/ip6_output.c
··· 67 67 struct in6_addr *nexthop; 68 68 int ret; 69 69 70 - skb->protocol = htons(ETH_P_IPV6); 71 - skb->dev = dev; 72 - 73 70 if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr)) { 74 71 struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); 75 72 ··· 150 153 { 151 154 struct net_device *dev = skb_dst(skb)->dev; 152 155 struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); 156 + 157 + skb->protocol = htons(ETH_P_IPV6); 158 + skb->dev = dev; 153 159 154 160 if (unlikely(idev->cnf.disable_ipv6)) { 155 161 IP6_INC_STATS(net, idev, IPSTATS_MIB_OUTDISCARDS);