ipv6: Initial skb->dev and skb->protocol in ip6_output
Subsystems (3)
PATCH 1/1 ipv6: Initial skb->dev and skb->protocol in ip6_output
From: Chenbo Feng <[email protected]>
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.
--- net/ipv6/ip6_output.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/ipv6/ip6_output.c +3 -3
@@ -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);
Signature · 1 line
2.7.4
From: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:06:07 -0700
Quoted 8 lines
From: Chenbo Feng <[email protected]>
Move the initialization of
skb->devandskb->protocolfromip6_finish_output2toip6_output. This can make theskb->devandskb->protocolinformation avalaible to the CGROUP eBPF filter.Signed-off-by Chenbo Feng <[email protected]>Acked-by Eric Dumazet <[email protected]>
Applied, thanks.
This makes ipv6 consistent with ipv4.
I am surprised this wasn't noticed, for example, in netfilter.
Quoted 9 lines · David Miller
From: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:06:07 -0700Quoted 6 lines
From: Chenbo Feng <[email protected]>
Move the initialization of
skb->devandskb->protocolfromip6_finish_output2toip6_output. This can make theskb->devandskb->protocolinformation avalaible to the CGROUP eBPF filter.
Quoted 9 lines
Quoted 2 lines
Signed-off-by Chenbo Feng <[email protected]>Acked-by Eric Dumazet <[email protected]>Applied, thanks.
This makes ipv6 consistent with ipv4.
I am surprised this wasn't noticed, for example, in netfilter. .
Hi David,
This patch is still under working since it may have problem with ip_fragment() call, did you applied it already? Should I send a revert patch to you then?
Chenbo Feng
Quoted 3 lines · Chenbo Feng
This patch is still under working since it may have problem with
ip_fragment()call, did you applied it already? Should I send a revert patch to you then?
It does? I initially thought so too, but looking closer I believe the ip6_copy_metadata() calls in ip6_fragment() takes care of it.
Bjørn
Quoted 5 lines · Bjørn Mork
Quoted 3 lines · Chenbo Feng
This patch is still under working since it may have problem with
ip_fragment()call, did you applied it already? Should I send a revert patch to you then?
Quoted 7 lines
It does? I initially thought so too, but looking closer I believe the
ip6_copy_metadata()calls inip6_fragment()takes care of it.Bjørn
At least in the fail_toobig code path of ip_fragment() call, skb->dev get assigned again. It seems to be redundant with this patch or it will rewrite the skb->dev field. I will revert this one and upload again after I have a proper handle for that.
Quoted 8 lines · Bjørn Mork
Quoted 3 lines · Chenbo Feng
This patch is still under working since it may have problem with
ip_fragment()call, did you applied it already? Should I send a revert patch to you then?It does? I initially thought so too, but looking closer I believe the
ip6_copy_metadata()calls inip6_fragment()takes care of it.
Indeed, this should be fine.
David Miller
maintainerFrom: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:13:57 -0700
Quoted 18 lines · David Miller
Quoted 15 lines
From: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:06:07 -0700Quoted 8 lines
From: Chenbo Feng <[email protected]>
Move the initialization of
skb->devandskb->protocolfromip6_finish_output2toip6_output. This can make theskb->devandskb->protocolinformation avalaible to the CGROUP eBPF filter.Signed-off-by Chenbo Feng <[email protected]>Acked-by Eric Dumazet <[email protected]>Applied, thanks.
This makes ipv6 consistent with ipv4.
Quoted 8 lines
Quoted 3 lines
I am surprised this wasn't noticed, for example, in netfilter. .
Hi David,
This patch is still under working since it may have problem with
ip_fragment()call, did you applied it already? Should I send a revert patch to you then?
A revert is necessary or a relative fixup.
Thank you.
Quoted 23 lines · David Miller
From: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:13:57 -0700Quoted 20 lines · David Miller
Quoted 18 lines
From: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:06:07 -0700Quoted 8 lines
From: Chenbo Feng <[email protected]>
Move the initialization of
skb->devandskb->protocolfromip6_finish_output2toip6_output. This can make theskb->devandskb->protocolinformation avalaible to the CGROUP eBPF filter.Signed-off-by Chenbo Feng <[email protected]>Acked-by Eric Dumazet <[email protected]>Applied, thanks.
This makes ipv6 consistent with ipv4.
I am surprised this wasn't noticed, for example, in netfilter. .
Quoted 9 lines
Quoted 5 lines
Hi David,
This patch is still under working since it may have problem with
ip_fragment()call, did you applied it already? Should I send a revert patch to you then?A revert is necessary or a relative fixup.
Thank you.
Hi David,
The revert is uploaded here: http://patchwork.ozlabs.org/patch/774136/
Thanks and sorry for the trouble caused
Chenbo Feng
Quoted 34 lines · Chenbo Feng
Quoted 23 lines · David Miller
From: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:13:57 -0700Quoted 20 lines · David Miller
Quoted 18 lines
From: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:06:07 -0700Quoted 8 lines
From: Chenbo Feng <[email protected]>
Move the initialization of
skb->devandskb->protocolfromip6_finish_output2toip6_output. This can make theskb->devandskb->protocolinformation avalaible to the CGROUP eBPF filter.Signed-off-by Chenbo Feng <[email protected]>Acked-by Eric Dumazet <[email protected]>Applied, thanks.
This makes ipv6 consistent with ipv4.
I am surprised this wasn't noticed, for example, in netfilter. .
Quoted 9 lines
Quoted 5 lines
Hi David,
This patch is still under working since it may have problem with
ip_fragment()call, did you applied it already? Should I send a revert patch to you then?A revert is necessary or a relative fixup.
Thank you.
Quoted 7 lines
Hi David,
The revert is uploaded here: http://patchwork.ozlabs.org/patch/774136/
Thanks and sorry for the trouble caused
Chenbo Feng
No worries !
It seems the revert is not needed, after further analysis.
One of the point I raised was this no longer needed chunk, that can be added as a separate patch :
net/ipv6/ip6_output.c +0 -1
@@ -869,7 +869,6 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,if (skb->sk &&dst_allfrag (skb_dst (skb)))sk_nocaps_add (skb->sk,NETIF_F_GSO_MASK ); - skb->dev =skb_dst (skb)->dev;icmpv6_send (skb,ICMPV6_PKT_TOOBIG ,0 , mtu); err = -EMSGSIZE ;
A message that is not in the archive (sent off-list or not yet received): CAMOXUJnJ+e=f3x7gZsh4f=Fn01pspDqMKJFqc7cb7umV8SXtaw@mail.gmail.com
David Miller
maintainerFrom: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:08:39 -0700
Quoted 1 line
Sorry, this is the wrong patch, please ignore it.
:-/ already applied it.
You must now send a relative fixup patch.
Quoted 9 lines · Chenbo Feng
From: Chenbo Feng <[email protected]>
Move the initialization of
skb->devandskb->protocolfromip6_finish_output2toip6_output. This can make theskb->devandskb->protocolinformation avalaible to the CGROUP eBPF filter.Signed-off-by Chenbo Feng <[email protected]>Acked-by Eric Dumazet <[email protected]>---
Arg, you mixed my Acked-by for your other patch :/