Re: [Patch net v3] ip_gre: set dev->hard_header_len and dev->needed_headroom properly

2020-10-13 Thread Jakub Kicinski
On Mon, 12 Oct 2020 16:17:21 -0700 Cong Wang wrote: > GRE tunnel has its own header_ops, ipgre_header_ops, and sets it > conditionally. When it is set, it assumes the outer IP header is > already created before ipgre_xmit(). > > This is not true when we send packets through a raw packet socket, >

Re: [Patch net v3] ip_gre: set dev->hard_header_len and dev->needed_headroom properly

2020-10-12 Thread Xie He
On Mon, Oct 12, 2020 at 4:17 PM Cong Wang wrote: > > GRE tunnel has its own header_ops, ipgre_header_ops, and sets it > conditionally. When it is set, it assumes the outer IP header is > already created before ipgre_xmit(). > > This is not true when we send packets through a raw packet socket, > w

Re: [Patch net v3] ip_gre: set dev->hard_header_len and dev->needed_headroom properly

2020-10-12 Thread Xie He
On Mon, Oct 12, 2020 at 4:17 PM Cong Wang wrote: > > Note, there are some other suspicious use of dev->hard_header_len in > the same file, but let's leave them to a separate patch if really > needed. I looked at the file (before this patch). There are 4 occurrences of hard_header_len, but they ar

[Patch net v3] ip_gre: set dev->hard_header_len and dev->needed_headroom properly

2020-10-12 Thread Cong Wang
GRE tunnel has its own header_ops, ipgre_header_ops, and sets it conditionally. When it is set, it assumes the outer IP header is already created before ipgre_xmit(). This is not true when we send packets through a raw packet socket, where L2 headers are supposed to be constructed by user. Packet