Re: [PATCH net 1/2] bpf: Fix bpf_redirect to an ipip/ip6tnl dev

2019-01-15 Thread Willem de Bruijn
On Thu, Jan 10, 2019 at 5:44 PM Willem de Bruijn wrote: > > On Thu, Jan 10, 2019 at 5:22 PM Daniel Borkmann wrote: > > > > On 01/10/2019 09:41 PM, Willem de Bruijn wrote: > > > On Wed, Nov 9, 2016 at 6:57 PM Martin KaFai Lau wrote: > > >> > > >> If the bpf program calls bpf_redirect(dev, 0) and

Re: [PATCH net 1/2] bpf: Fix bpf_redirect to an ipip/ip6tnl dev

2019-01-10 Thread Willem de Bruijn
On Thu, Jan 10, 2019 at 5:22 PM Daniel Borkmann wrote: > > On 01/10/2019 09:41 PM, Willem de Bruijn wrote: > > On Wed, Nov 9, 2016 at 6:57 PM Martin KaFai Lau wrote: > >> > >> If the bpf program calls bpf_redirect(dev, 0) and dev is > >> an ipip/ip6tnl, it currently includes the mac header. > >>

Re: [PATCH net 1/2] bpf: Fix bpf_redirect to an ipip/ip6tnl dev

2019-01-10 Thread Daniel Borkmann
On 01/10/2019 09:41 PM, Willem de Bruijn wrote: > On Wed, Nov 9, 2016 at 6:57 PM Martin KaFai Lau wrote: >> >> If the bpf program calls bpf_redirect(dev, 0) and dev is >> an ipip/ip6tnl, it currently includes the mac header. >> e.g. If dev is ipip, the end result is IP-EthHdr-IP instead >> of IP-I

Re: [PATCH net 1/2] bpf: Fix bpf_redirect to an ipip/ip6tnl dev

2019-01-10 Thread Willem de Bruijn
On Wed, Nov 9, 2016 at 6:57 PM Martin KaFai Lau wrote: > > If the bpf program calls bpf_redirect(dev, 0) and dev is > an ipip/ip6tnl, it currently includes the mac header. > e.g. If dev is ipip, the end result is IP-EthHdr-IP instead > of IP-IP. > > The fix is to pull the mac header. At ingress,

[PATCH net 1/2] bpf: Fix bpf_redirect to an ipip/ip6tnl dev

2016-11-09 Thread Martin KaFai Lau
If the bpf program calls bpf_redirect(dev, 0) and dev is an ipip/ip6tnl, it currently includes the mac header. e.g. If dev is ipip, the end result is IP-EthHdr-IP instead of IP-IP. The fix is to pull the mac header. At ingress, skb_postpull_rcsum() is not needed because the ethhdr should have bee