]> git.baikalelectronics.ru Git - kernel.git/commit
packet: only test po->has_vnet_hdr once in packet_snd
authorWillem de Bruijn <willemb@google.com>
Tue, 26 Sep 2017 16:20:17 +0000 (12:20 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Sep 2017 17:24:31 +0000 (10:24 -0700)
commit323a2b435a6124a7c37525c7f26d0129c14ee8d7
treef7b60e018e78a975e17e327f614e6dddb07ea306
parent3daa6d4b1953d4705cfa558ec543a739f3ea5630
packet: only test po->has_vnet_hdr once in packet_snd

Packet socket option po->has_vnet_hdr can be updated concurrently with
other operations if no ring is attached.

Do not test the option twice in packet_snd, as the value may change in
between calls. A race on setsockopt disable may cause a packet > mtu
to be sent without having GSO options set.

Fixes: 09a22ba4d6d4 ("packet: Add GSO/csum offload support.")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c