public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Chenbo Feng <chenbofeng.kernel@gmail.com>
To: netdev@vger.kernel.org, David Miller <davem@davemloft.net>
Cc: Lorenzo Colitti <lorenzo@google.com>,
	Eric Dumazet <edumazet@google.com>,
	Chenbo Feng <fengc@google.com>
Subject: [PATCH net-next] ipv6: Initial skb->dev and skb->protocol in ip6_output
Date: Fri,  9 Jun 2017 12:06:07 -0700	[thread overview]
Message-ID: <1497035168-9093-1-git-send-email-chenbofeng.kernel@gmail.com> (raw)

From: Chenbo Feng <fengc@google.com>

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>
---
 net/ipv6/ip6_output.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index bf8a58a..02cd44f 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));
 
@@ -154,6 +151,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);
-- 
2.7.4

             reply	other threads:[~2017-06-09 19:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09 19:06 Chenbo Feng [this message]
2017-06-09 19:08 ` [PATCH net-next] ipv6: Initial skb->dev and skb->protocol in ip6_output David Miller
2017-06-09 19:13   ` Chenbo Feng
2017-06-09 19:24     ` Bjørn Mork
2017-06-09 19:45       ` Chenbo Feng
2017-06-10 14:56       ` Eric Dumazet
2017-06-09 19:39     ` David Miller
2017-06-09 23:12       ` Chenbo Feng
2017-06-10 14:54         ` Eric Dumazet
     [not found] ` <CAMOXUJnJ+e=f3x7gZsh4f=Fn01pspDqMKJFqc7cb7umV8SXtaw@mail.gmail.com>
2017-06-09 19:39   ` David Miller
2017-06-09 21:11 ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497035168-9093-1-git-send-email-chenbofeng.kernel@gmail.com \
    --to=chenbofeng.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fengc@google.com \
    --cc=lorenzo@google.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox