[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 12 Nov 2015 00:07:42 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
CC: David Miller <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Tobias Klauser <tklauser@...tanz.ch>,
Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH net v3 3/5] packet: only allow extra vlan len on ethernet
devices
On 11/11/2015 11:55 PM, Willem de Bruijn wrote:
> On Wed, Nov 11, 2015 at 5:25 PM, Daniel Borkmann <daniel@...earbox.net> wrote:
...
>> + if (!gso_type && (len > dev->mtu + reserve + extra_len) &&
>> + !packet_extra_vlan_len_allowed(dev, skb)) {
>> + err = -EMSGSIZE;
>> + goto out_free;
>
> This nicely reuses the same code in three locations.
>
> If you end up having to send a v4, it would be nice to also fold the
> repeated len check into the shared code. Variable reserve here is
> just dev->hard_header_len. No need to spin a patch just for that
> cleanup, though.
Noted, I was also thinking for net-next to move the tpacket_snd() check
into tpacket_fill_skb(), that would save us to do the likely(tp_len >= 0)
check there. Can take care of both when net-next opens, I feared there
would be critics that it's not ending up minimal enough otherwise. ;)
Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists