From: Chenbo Feng Date: Fri, 9 Jun 2017 19:06:07 +0000 (-0700) Subject: FROMLIST: ipv6: Initial skb->dev and skb->protocol in ip6_output X-Git-Tag: khadas-vims-v0.9.6-release~1584^2~677 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c4f58af89edfb798e2212618a5c4337010dd431;p=platform%2Fkernel%2Flinux-amlogic.git FROMLIST: 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 Acked-by: Eric Dumazet Signed-off-by: David S. Miller (url: http://patchwork.ozlabs.org/patch/774124/) Bug: 30950746 Change-Id: Iac2304f7ba8cd769ee01a062cde2deb50562c3ad --- diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index d472a5f..1b2ed0e 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -67,9 +67,6 @@ static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff * struct in6_addr *nexthop; int ret; - skb->protocol = htons(ETH_P_IPV6); - skb->dev = dev; - if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr)) { struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); @@ -153,6 +150,9 @@ int ip6_output(struct net *net, struct sock *sk, struct sk_buff *skb) struct net_device *dev = skb_dst(skb)->dev; struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); + skb->protocol = htons(ETH_P_IPV6); + skb->dev = dev; + if (unlikely(idev->cnf.disable_ipv6)) { IP6_INC_STATS(net, idev, IPSTATS_MIB_OUTDISCARDS); kfree_skb(skb);