Re: [PATCH 4/7] net/packet: Ask driver for protocol if not provided by user

2019-01-17 Thread Willem de Bruijn
On Thu, Jan 17, 2019 at 4:10 AM Maxim Mikityanskiy wrote: > > > > > +static void packet_parse_headers(struct sk_buff *skb, struct socket > > *sock) > > > > +{ > > > > + if (!skb->protocol && sock->type == SOCK_RAW) { > > > > + skb_reset_mac_header(skb); > > > > +

RE: [PATCH 4/7] net/packet: Ask driver for protocol if not provided by user

2019-01-17 Thread Maxim Mikityanskiy
> > > +static void packet_parse_headers(struct sk_buff *skb, struct socket > *sock) > > > +{ > > > + if (!skb->protocol && sock->type == SOCK_RAW) { > > > + skb_reset_mac_header(skb); > > > + skb->protocol = dev_parse_header_protocol(skb); > > > + } > > > + >

Re: [PATCH 4/7] net/packet: Ask driver for protocol if not provided by user

2019-01-15 Thread Willem de Bruijn
On Mon, Jan 14, 2019 at 11:52 AM Willem de Bruijn wrote: > > On Mon, Jan 14, 2019 at 8:20 AM Maxim Mikityanskiy > wrote: > > > > If a socket was created with socket(AF_PACKET, SOCK_RAW, 0), the > > protocol number is unavailable. Try to ask the driver to extract it from > > the L2 header in orde

Re: [PATCH 4/7] net/packet: Ask driver for protocol if not provided by user

2019-01-14 Thread Willem de Bruijn
On Mon, Jan 14, 2019 at 8:20 AM Maxim Mikityanskiy wrote: > > If a socket was created with socket(AF_PACKET, SOCK_RAW, 0), the > protocol number is unavailable. Try to ask the driver to extract it from > the L2 header in order for skb_try_probe_transport_header to succeed. > > Signed-off-by: Maxim