On Wed, Nov 11, 2015 at 6:07 PM, Daniel Borkmann <dan...@iogearbox.net> wrote: > On 11/11/2015 11:55 PM, Willem de Bruijn wrote: >> >> On Wed, Nov 11, 2015 at 5:25 PM, Daniel Borkmann <dan...@iogearbox.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. ;)
Fair point :) > > Thanks, > Daniel > -- > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html