b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@meshcoding.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, "Martin Hundebøll" <martin@hundeboll.net>,
	b.a.t.m.a.n@lists.open-mesh.org,
	"Marek Lindner" <mareklindner@neomailbox.ch>,
	"Antonio Quartulli" <antonio@meshcoding.com>
Subject: [B.A.T.M.A.N.] [PATCH 12/15] batman-adv: clear control block of received socket buffers
Date: Thu,  8 Jan 2015 16:15:17 +0100	[thread overview]
Message-ID: <1420730120-9844-13-git-send-email-antonio@meshcoding.com> (raw)
In-Reply-To: <1420730120-9844-1-git-send-email-antonio@meshcoding.com>

From: Martin Hundebøll <martin@hundeboll.net>

Since other network components (and some drivers) uses the control block
provided in skb's, the network coding feature might wrongly assume that
an SKB has been decoded, and thus not try to code it with another packet
again. This happens for instance when batman-adv is running on a bridge device.

Fix this by clearing the control block for every received SKB.

Introduced by 3c12de9a5c756b23fe7c9ab332474ece1568914c
("batman-adv: network coding - code and transmit packets if possible")
Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>

Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
---
 net/batman-adv/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index d4079cd..3bcd847 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -402,6 +402,9 @@ int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
 		goto err_free;
 	}
 
+	/* reset control block to avoid left overs from previous users */
+	memset(skb->cb, 0, sizeof(struct batadv_skb_cb));
+
 	/* all receive handlers return whether they received or reused
 	 * the supplied skb. if not, we have to free the skb.
 	 */
-- 
2.2.1


  parent reply	other threads:[~2015-01-08 15:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 15:15 [B.A.T.M.A.N.] pull request: batman-adv 20150108 Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 01/15] batman-adv: avoid useless return in void functions Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 02/15] batman-adv: remove obsolete variable primary_iface from orig_node Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 03/15] batman-adv: kernel doc fixes for bat_iv_ogm.c Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 04/15] batman-adv: kernel doc fixes for bridge_loop_avoidance.c Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 05/15] batman-adv: kernel doc fix for distributed-arp-table.h Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 06/15] batman-adv: kernel doc fixes for main.{c, h} Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 07/15] batman-adv: checkpatch - else is not generally useful after a break or return Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 08/15] batman-adv: checkpatch - No space is necessary after a cast Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 09/15] batman-adv: checkpatch - Please use a blank line after declarations Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 10/15] batman-adv: checkpatch - Please don't use multiple blank lines Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 11/15] batman-adv: checkpatch - remove unnecessary parentheses Antonio Quartulli
2015-01-08 15:15 ` Antonio Quartulli [this message]
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 13/15] batman-adv: fix misspelled words Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 14/15] batman-adv: Start new development cycle Antonio Quartulli
2015-01-08 15:15 ` [B.A.T.M.A.N.] [PATCH 15/15] batman-adv: Kconfig, Add missing DEBUG_FS dependency Antonio Quartulli
2015-01-09  4:14 ` [B.A.T.M.A.N.] pull request: batman-adv 20150108 David Miller

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=1420730120-9844-13-git-send-email-antonio@meshcoding.com \
    --to=antonio@meshcoding.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=mareklindner@neomailbox.ch \
    --cc=martin@hundeboll.net \
    --cc=netdev@vger.kernel.org \
    /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).