From: David Miller <davem@davemloft.net>
To: willemdebruijn.kernel@gmail.com
Cc: alan@linux.intel.com, hessu@hes.iki.fi, netdev@vger.kernel.org,
willemb@google.com
Subject: Re: Sending short raw packets using sendmsg() broke
Date: Fri, 26 Feb 2016 12:46:45 -0500 (EST) [thread overview]
Message-ID: <20160226.124645.2123990166666725876.davem@davemloft.net> (raw)
In-Reply-To: <CAF=yD-JOQZZnU6XE9FhEVbxstKmsB-ds58e5v678SiO24VV0+g@mail.gmail.com>
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Fri, 26 Feb 2016 12:33:13 -0500
> Right. The simplest, if hacky, fix is to add something along the lines of
>
> static unsigned short netdev_min_hard_header_len(struct net_device *dev)
> {
> if (unlikely(dev->type ==ARPHDR_AX25))
> return AX25_KISS_HEADER_LEN;
> else
> return dev->hard_header_len;
> }
>
> Depending on how the variable encoding scheme works, a basic min
> length check may still produce buggy headers that confuse the stack or
> driver. I need to read up on AX25. If so, then extending header_ops
> with an optional validate() function is a more generic approach of
> checking header sanity.
I suspect we will need some kind of header ops for this.
next prev parent reply other threads:[~2016-02-26 17:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 19:36 Sending short raw packets using sendmsg() broke Heikki Hannikainen
2016-02-25 20:26 ` David Miller
2016-02-26 14:44 ` Alan Cox
2016-02-26 17:33 ` Willem de Bruijn
2016-02-26 17:46 ` David Miller [this message]
2016-02-27 23:02 ` Willem de Bruijn
2016-03-02 0:00 ` Alan Cox
2016-03-03 16:40 ` Willem de Bruijn
2016-03-03 16:43 ` Willem de Bruijn
2016-03-04 15:54 ` Alan Cox
2016-03-04 16:33 ` Willem de Bruijn
2016-03-04 20:52 ` Willem de Bruijn
2016-03-01 23:34 ` Alan Cox
2016-02-26 17:34 ` David Miller
2016-02-25 20:49 ` Willem de Bruijn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160226.124645.2123990166666725876.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alan@linux.intel.com \
--cc=hessu@hes.iki.fi \
--cc=netdev@vger.kernel.org \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).