public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: Matthias Schiffer <mschiffer@universe-factory.net>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix skbuff rcsum on packet reroute
Date: Mon, 19 Mar 2018 14:14:04 +0100	[thread overview]
Message-ID: <6825317.Bh3rAZBzc7@bentobox> (raw)
In-Reply-To: <b50d17c8-e55f-6a05-88db-acdcc4c35732@universe-factory.net>

[-- Attachment #1: Type: text/plain, Size: 1678 bytes --]

On Montag, 19. März 2018 14:02:43 CET Matthias Schiffer wrote:
> Using skb_postpull_rcsum here is incorrect: As the name indicates, it is
> supposed to be used after pulling, and will thus subtract the checksum of
> the header *before* skb->data, while we are interested in the
> sizeof(*unicast_packet) bytes *after* skb->data.

Can you please explain this a little bit further. You give skb_postpull_rcsum 
the start and length via parameter and it is writing the resulting csum in the
skb. It is not checking or accessing the position of skb->data [1]

    /**
     *	skb_postpull_rcsum - update checksum for received skb after pull
     *	@skb: buffer to update
     *	@start: start of data before pull
     *	@len: length of data pulled
     *
     *	After doing a pull on a received packet, you need to call this to
     *	update the CHECKSUM_COMPLETE checksum, or set ip_summed to
     *	CHECKSUM_NONE so that it can be recomputed from scratch.
     */

See also __skb_postpull_rcsum [2]:

		skb->csum = csum_block_sub(skb->csum,
					   csum_partial(start, len, 0), off);

What about the examples I gave in my patch - for example the easy-to-read 
set_eth_addr [3]?

Kind regards,
	Sven

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/skbuff.h?id=c698ca5278934c0ae32297a8725ced2e27585d7f#n3070
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/skbuff.h?id=c698ca5278934c0ae32297a8725ced2e27585d7f#n3058
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/openvswitch/actions.c?id=c698ca5278934c0ae32297a8725ced2e27585d7f#n319

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-03-19 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-18 12:12 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix skbuff rcsum on packet reroute Sven Eckelmann
2018-03-19 13:02 ` Matthias Schiffer
2018-03-19 13:14   ` Sven Eckelmann [this message]
2018-03-19 13:19     ` Matthias Schiffer
2018-03-19 13:31       ` Sven Eckelmann

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=6825317.Bh3rAZBzc7@bentobox \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=mschiffer@universe-factory.net \
    /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