b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
	"Linus Lüssing" <linus.luessing@c0d3.blue>,
	"Sven Eckelmann" <sven@narfation.org>,
	"Simon Wunderlich" <sw@simonwunderlich.de>
Subject: [B.A.T.M.A.N.] [PATCH 11/12] batman-adv: allow updating DAT entry timeouts on incoming ARP Replies
Date: Thu, 28 Mar 2019 16:41:51 +0100	[thread overview]
Message-ID: <20190328154152.20552-12-sw@simonwunderlich.de> (raw)
In-Reply-To: <20190328154152.20552-1-sw@simonwunderlich.de>

From: Linus Lüssing <linus.luessing@c0d3.blue>

Currently incoming ARP Replies, for example via a DHT-PUT message, do
not update the timeout for an already existing DAT entry. These ARP
Replies are dropped instead.

This however defeats the purpose of the DHCPACK snooping, for instance.
Right now, a DAT entry in the DHT will be purged every five minutes,
likely leading to a mesh-wide ARP Request broadcast after this timeout.
Which then recreates the entry. The idea of the DHCPACK snooping is to
be able to update an entry before a timeout happens, to avoid ARP Request
flooding.

This patch fixes this issue by updating a DAT entry on incoming
ARP Replies even if a matching DAT entry already exists. While still
filtering the ARP Reply towards the soft-interface, to avoid duplicate
messages on the client device side.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/distributed-arp-table.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 81fc63fc1936..b0af3a11d406 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -1434,7 +1434,6 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
 			   hw_src, &ip_src, hw_dst, &ip_dst,
 			   dat_entry->mac_addr,	&dat_entry->ip);
 		dropped = true;
-		goto out;
 	}
 
 	/* Update our internal cache with both the IP addresses the node got
@@ -1443,6 +1442,9 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
 	batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
 	batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid);
 
+	if (dropped)
+		goto out;
+
 	/* If BLA is enabled, only forward ARP replies if we have claimed the
 	 * source of the ARP reply or if no one else of the same backbone has
 	 * already claimed that client. This prevents that different gateways
-- 
2.11.0


  parent reply	other threads:[~2019-03-28 15:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 15:41 [B.A.T.M.A.N.] [PATCH 00/12] pull request for net-next: batman-adv 2019-03-28 Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 01/12] batman-adv: Drop license boilerplate Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 02/12] batman-adv: Drop documentation about debugfs files Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 03/12] batman-adv: Drop documentation about sysfs files Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 04/12] batman-adv: Make sysfs support optional Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 05/12] batman-adv: ABI: Mark sysfs files as deprecated Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 06/12] batman-adv: Warn about sysfs file access Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 07/12] MAINTAINERS: Add B(ugtracker) field for batman-adv Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 08/12] MAINTAINERS: Add C(hat) " Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 09/12] MAINTAINERS: Add T(ree) " Simon Wunderlich
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 10/12] batman-adv: Adjust name for batadv_dat_send_data Simon Wunderlich
2019-03-28 15:41 ` Simon Wunderlich [this message]
2019-03-28 15:41 ` [B.A.T.M.A.N.] [PATCH 12/12] batman-adv: Add multicast-to-unicast support for multiple targets Simon Wunderlich
2019-03-28 16:54 ` [B.A.T.M.A.N.] [PATCH 00/12] pull request for net-next: batman-adv 2019-03-28 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=20190328154152.20552-12-sw@simonwunderlich.de \
    --to=sw@simonwunderlich.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=linus.luessing@c0d3.blue \
    --cc=netdev@vger.kernel.org \
    --cc=sven@narfation.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).