b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH v5 3/6] batman-adv: prevent duplication of ARP replies when DAT is used
Date: Fri, 01 Jul 2016 16:11:12 +0200	[thread overview]
Message-ID: <1763113.8FgPGrc5MB@prime> (raw)
In-Reply-To: <1465557064-24406-4-git-send-email-apape@phoenixcontact.com>

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

On Friday 10 June 2016 13:11:01 Andreas Pape wrote:
> If none of the backbone gateways in a bla setup has already knowledge of
> the mac address searched for in an incoming ARP request from the backbone
> an address resolution via the DHT of DAT is started. The gateway can send
> several ARP requests to different DHT nodes and therefore can get several
> replies. This patch assures that not all of the possible ARP replies are
> returned to the backbone by checking the local DAT cache of the gateway.
> If there is an entry in the local cache the gateway has already learned
> the requested address and there is no need to forward the additional reply
> to the backbone.
> Furthermore it is checked if this gateway has claimed the source of the ARP
> reply and only forwards it to the backbone if it has claimed the source or
> if there is no claim at all.

Acked-by: Simon Wunderlich <sw@simonwunderlich.de>

but one small style suggestion below:

> 
> Signed-off-by: Andreas Pape <apape@phoenixcontact.com>
> ---
>  net/batman-adv/distributed-arp-table.c |   32
> ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0
> deletions(-)
> 
> diff --git a/net/batman-adv/distributed-arp-table.c
> b/net/batman-adv/distributed-arp-table.c index 998a4b8..e7b054a 100644
> --- a/net/batman-adv/distributed-arp-table.c
> +++ b/net/batman-adv/distributed-arp-table.c
> @@ -1244,6 +1244,7 @@ bool batadv_dat_snoop_incoming_arp_reply(struct
> batadv_priv *bat_priv, __be32 ip_src, ip_dst;
>  	u8 *hw_src, *hw_dst;
>  	bool dropped = false;
> +	struct batadv_dat_entry *dat_entry = NULL;
>  	unsigned short vid;
> 
>  	if (!atomic_read(&bat_priv->distributed_arp_table))
> @@ -1263,12 +1264,41 @@ bool batadv_dat_snoop_incoming_arp_reply(struct
> batadv_priv *bat_priv, hw_dst = batadv_arp_hw_dst(skb, hdr_size);
>  	ip_dst = batadv_arp_ip_dst(skb, hdr_size);
> 
> +	/* If ip_dst is already in cache and has the right mac address,
> +	 * drop this frame if this ARP reply is destined for us because it's
> +	 * most probably an ARP reply generated by another node of the DHT.
> +	 * We have most probably received already a reply earlier. Delivering
> +	 * this frame would lead to doubled receive of an ARP reply.
> +	 */
> +	dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_src, vid);
> +	if ((dat_entry) && (batadv_compare_eth(hw_src, dat_entry->mac_addr))) {

you can drop the braces for dat_entry and batadv_compare_eth here.

Cheers,
     Simon

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

  reply	other threads:[~2016-07-01 14:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 11:10 [B.A.T.M.A.N.] [PATCH v5 0/6] Optimizations for setups running dat and bla Andreas Pape
2016-06-10 11:10 ` [B.A.T.M.A.N.] [PATCH v5 1/6] batman-adv: prevent multiple ARP replies sent by gateways if dat enbled Andreas Pape
2016-07-01 13:52   ` Simon Wunderlich
2016-06-10 11:11 ` [B.A.T.M.A.N.] [PATCH v5 2/6] batman-adv: speed up dat by snooping received ip traffic Andreas Pape
2016-06-25 10:04   ` Sven Eckelmann
2016-06-26  8:54     ` Ruben Wisniewski
2016-06-26  9:29       ` Sven Eckelmann
2016-07-01 13:49   ` Simon Wunderlich
2016-07-19  6:29     ` Linus Lüssing
2016-07-19  6:59       ` Sven Eckelmann
2016-07-19  7:06         ` Ruben Wisniewski
2016-07-19 16:15           ` Linus Lüssing
2016-07-19 16:13         ` Linus Lüssing
2016-06-10 11:11 ` [B.A.T.M.A.N.] [PATCH v5 3/6] batman-adv: prevent duplication of ARP replies when DAT is used Andreas Pape
2016-07-01 14:11   ` Simon Wunderlich [this message]
2016-06-10 11:11 ` [B.A.T.M.A.N.] [PATCH v5 4/6] batman-adv: drop unicast packets from other backbone gw Andreas Pape
2016-07-01 13:48   ` Simon Wunderlich
2016-06-10 11:11 ` [B.A.T.M.A.N.] [PATCH v5 5/6] batman-adv: changed debug messages for easier bla debugging Andreas Pape
2016-06-10 11:11 ` [B.A.T.M.A.N.] [PATCH v5 6/6] batman-adv: handle race condition for claims between gateways Andreas Pape
2016-06-10 11:51 ` [B.A.T.M.A.N.] [PATCH v5 0/6] Optimizations for setups running dat and bla Sven Eckelmann
2016-06-13  8:06   ` Andreas Pape
2016-06-13  9:01     ` Sven Eckelmann
2016-07-01 14:12       ` Simon Wunderlich

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=1763113.8FgPGrc5MB@prime \
    --to=sw@simonwunderlich.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.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).