From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Alexander Aring <aring@mojatatu.com>, stefan@osg.samsung.com
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org, kernel@mojatatu.com
Subject: Re: [PATCH wpan 2/2] net: mac802154: tx: expand tailroom if necessary
Date: Mon, 6 Aug 2018 11:26:51 +0200 [thread overview]
Message-ID: <11cbdc42-feb6-28af-db3f-2b28cd22700e@datenfreihafen.org> (raw)
In-Reply-To: <20180702203203.21316-2-aring@mojatatu.com>
Hello.
On 07/02/2018 10:32 PM, Alexander Aring wrote:
> This patch is necessary if case of AF_PACKET or other socket interface
> which I am aware of it and didn't allocated the necessary room.
>
> Reported-by: David Palma <david.palma@ntnu.no>
> Reported-by: Rabi Narayan Sahoo <rabinarayans0828@gmail.com>
> Signed-off-by: Alexander Aring <aring@mojatatu.com>
> ---
> net/mac802154/tx.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> index 7e253455f9dd..bcd1a5e6ebf4 100644
> --- a/net/mac802154/tx.c
> +++ b/net/mac802154/tx.c
> @@ -63,8 +63,21 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
> int ret;
>
> if (!(local->hw.flags & IEEE802154_HW_TX_OMIT_CKSUM)) {
> - u16 crc = crc_ccitt(0, skb->data, skb->len);
> + struct sk_buff *nskb;
> + u16 crc;
> +
> + if (unlikely(skb_tailroom(skb) < IEEE802154_FCS_LEN)) {
> + nskb = skb_copy_expand(skb, 0, IEEE802154_FCS_LEN,
> + GFP_ATOMIC);
> + if (likely(nskb)) {
> + consume_skb(skb);
> + skb = nskb;
> + } else {
> + goto err_tx;
> + }
> + }
>
> + crc = crc_ccitt(0, skb->data, skb->len);
> put_unaligned_le16(crc, skb_put(skb, 2));
> }
>
>
This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!
I know you submitted this for wpan instead of wpan-next, but with rc8
being out I will not submit another pull request for 4.18. Instead I
added cc stable to the patch to make sure it gets picked into the stable
tree once 4.18 is out.
regards
Stefan Schmidt
next prev parent reply other threads:[~2018-08-06 11:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 20:32 [PATCH wpan 1/2] net: 6lowpan: fix reserved space for single frames Alexander Aring
2018-07-02 20:32 ` [PATCH wpan 2/2] net: mac802154: tx: expand tailroom if necessary Alexander Aring
2018-08-06 9:26 ` Stefan Schmidt [this message]
2018-07-05 11:16 ` [PATCH wpan 1/2] net: 6lowpan: fix reserved space for single frames Stefan Schmidt
2018-07-06 7:54 ` David Palma
2018-07-06 8:07 ` Stefan Schmidt
2018-07-06 10:06 ` Stefan Schmidt
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=11cbdc42-feb6-28af-db3f-2b28cd22700e@datenfreihafen.org \
--to=stefan@datenfreihafen.org \
--cc=aring@mojatatu.com \
--cc=kernel@mojatatu.com \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stefan@osg.samsung.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).