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: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 3/7] batman-adv: prevent duplication of ARP replies when DAT is used
Date: Fri, 26 Feb 2016 17:03:26 +0100	[thread overview]
Message-ID: <1642814.nAlCBA5LKq@bentobox> (raw)
In-Reply-To: <1456492719-29748-1-git-send-email-apape@phoenixcontact.com>

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

On Friday 26 February 2016 14:18:39 Andreas Pape wrote:
>  	dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst, vid);
> -	if (!dat_entry)
> +	if (!dat_entry) {
> +		/* Check if this is a 4addr unicast DAT_DHT_GET frame from
> +		 * another backbone gw of the same backbone. If yes, drop
> +		 * it as this leads to multiplication of arp requests in bla
> +		 * setups as long as there is no dat_entry fo this answer.
> +		 * In this case better drop the DHT_GET. Normal bla code
> +		 * doesn't take care of these packets as they are tunneled
> +		 * via unicast.
> +		 */
> +		unicast_4addr_packet =
> +				(struct batadv_unicast_4addr_packet *)skb->data;
> +		orig_node =
> +			batadv_orig_hash_find(bat_priv,
> +					      unicast_4addr_packet->src);
> +		if (orig_node) {
> +			if ((unicast_4addr_packet->u.packet_type ==
> +			     BATADV_UNICAST_4ADDR) &&
> +			     (unicast_4addr_packet->subtype ==
> +			      BATADV_P_DAT_DHT_GET) &&
> +			     (batadv_bla_is_backbone_gw(skb, orig_node,
> +							hdr_size))) {
> +				batadv_dbg(BATADV_DBG_DAT, bat_priv, "Doubled ARP request removed: ARP MSG = [src: %pM-%pI4 dst: %pM-%pI4]; originator: %pM\n",
> +					   hw_src, &ip_src,
> +					   batadv_arp_hw_dst(skb, hdr_size),
> +					   &ip_dst, unicast_4addr_packet->src);
> +				ret = true;
> +			}
> +			batadv_orig_node_put(orig_node);
> +		}
> +
>  		goto out;
> +	}

This looks really squashed. Maybe this stuff can be moved in a separate
function.

Kind regards,
	Sven

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

  reply	other threads:[~2016-02-26 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 13:18 [B.A.T.M.A.N.] [PATCHv2 3/7] batman-adv: prevent duplication of ARP replies when DAT is used Andreas Pape
2016-02-26 16:03 ` Sven Eckelmann [this message]
2016-03-10 15:07 ` 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=1642814.nAlCBA5LKq@bentobox \
    --to=sven@narfation.org \
    --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