Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396709

[PATCH 4.4 36/67] batman-adv: fix DAT candidate selection (must use vid)

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 36/67] batman-adv: fix DAT candidate selection (must use vid)
Date 2016-05-09 09:30 +0200
Message-ID <rwNNH-7J-91@gated-at.bofh.it> (permalink)
References <rwNDY-8jo-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Antonio Quartulli <a@unstable.cc>

commit 2871734e85e920503d49b3a8bc0afbe0773b6036 upstream.

Now that DAT is VLAN aware, it must use the VID when
computing the DHT address of the candidate nodes where
an entry is going to be stored/retrieved.

Fixes: be1db4f6615b ("batman-adv: make the Distributed ARP Table vlan aware")
Signed-off-by: Antonio Quartulli <a@unstable.cc>
[sven@narfation.org: fix conflicts with current version]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/batman-adv/distributed-arp-table.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -553,6 +553,7 @@ static void batadv_choose_next_candidate
  * be sent to
  * @bat_priv: the bat priv with all the soft interface information
  * @ip_dst: ipv4 to look up in the DHT
+ * @vid: VLAN identifier
  *
  * An originator O is selected if and only if its DHT_ID value is one of three
  * closest values (from the LEFT, with wrap around if needed) then the hash
@@ -561,7 +562,8 @@ static void batadv_choose_next_candidate
  * Returns the candidate array of size BATADV_DAT_CANDIDATE_NUM.
  */
 static struct batadv_dat_candidate *
-batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
+batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst,
+			     unsigned short vid)
 {
 	int select;
 	batadv_dat_addr_t last_max = BATADV_DAT_ADDR_MAX, ip_key;
@@ -577,7 +579,7 @@ batadv_dat_select_candidates(struct bata
 		return NULL;
 
 	dat.ip = ip_dst;
-	dat.vid = 0;
+	dat.vid = vid;
 	ip_key = (batadv_dat_addr_t)batadv_hash_dat(&dat,
 						    BATADV_DAT_ADDR_MAX);
 
@@ -597,6 +599,7 @@ batadv_dat_select_candidates(struct bata
  * @bat_priv: the bat priv with all the soft interface information
  * @skb: payload to send
  * @ip: the DHT key
+ * @vid: VLAN identifier
  * @packet_subtype: unicast4addr packet subtype to use
  *
  * This function copies the skb with pskb_copy() and is sent as unicast packet
@@ -607,7 +610,7 @@ batadv_dat_select_candidates(struct bata
  */
 static bool batadv_dat_send_data(struct batadv_priv *bat_priv,
 				 struct sk_buff *skb, __be32 ip,
-				 int packet_subtype)
+				 unsigned short vid, int packet_subtype)
 {
 	int i;
 	bool ret = false;
@@ -616,7 +619,7 @@ static bool batadv_dat_send_data(struct
 	struct sk_buff *tmp_skb;
 	struct batadv_dat_candidate *cand;
 
-	cand = batadv_dat_select_candidates(bat_priv, ip);
+	cand = batadv_dat_select_candidates(bat_priv, ip, vid);
 	if (!cand)
 		goto out;
 
@@ -1004,7 +1007,7 @@ bool batadv_dat_snoop_outgoing_arp_reque
 		ret = true;
 	} else {
 		/* Send the request to the DHT */
-		ret = batadv_dat_send_data(bat_priv, skb, ip_dst,
+		ret = batadv_dat_send_data(bat_priv, skb, ip_dst, vid,
 					   BATADV_P_DAT_DHT_GET);
 	}
 out:
@@ -1132,8 +1135,8 @@ void batadv_dat_snoop_outgoing_arp_reply
 	/* Send the ARP reply to the candidates for both the IP addresses that
 	 * the node obtained from the ARP reply
 	 */
-	batadv_dat_send_data(bat_priv, skb, ip_src, BATADV_P_DAT_DHT_PUT);
-	batadv_dat_send_data(bat_priv, skb, ip_dst, BATADV_P_DAT_DHT_PUT);
+	batadv_dat_send_data(bat_priv, skb, ip_src, vid, BATADV_P_DAT_DHT_PUT);
+	batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT);
 }
 
 /**

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 00/67] 4.4.10-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:30 +0200
  [PATCH 4.4 36/67] batman-adv: fix DAT candidate selection (must use vid) Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:30 +0200
  [PATCH 4.4 67/67] drm/i915/skl: Fix DMC load on Skylake J0 and K0 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:30 +0200
  [PATCH 4.4 30/67] xen/evtchn: fix ring resize when binding new events Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:30 +0200
  [PATCH 4.4 41/67] MAINTAINERS: Remove asterisk from EFI directory names Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:30 +0200
  [PATCH 4.4 26/67] ARM: EXYNOS: Properly skip unitialized parent clock in power domain on Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:30 +0200
  [PATCH 4.4 46/67] ARC: Add missing io barriers to io{read,write}{16,32}be() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:30 +0200
  [PATCH 4.4 05/67] ipvs: drop first packet to redirect conntrack Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 09/67] mwifiex: fix corner case association failure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 20/67] mac80211: fix statistics leak if dev_alloc_name() fails Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 22/67] MD: make bio mergeable Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 44/67] propogate_mnt: Handle the first propogated copy being a slave Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 08/67] ata: ahci_xgene: dereferencing uninitialized pointer in probe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 06/67] mfd: intel-lpss: Remove clock tree on error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 07/67] nbd: ratelimit error msgs after socket close Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 23/67] Minimal fix-up of bad hashing behavior of hash_64() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 29/67] xen/balloon: Fix crash when ballooning on x86 32 bit PAE Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 27/67] ARM: SoCFPGA: Fix secondary CPU startup in thumb2 kernel Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 25/67] mm/zswap: provide unique zpool name Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 42/67] x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 40/67] writeback: Fix performance regression in wb_over_bg_thresh() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 09:40 +0200
  [PATCH 4.4 12/67] soc: rockchip: power-domain: fix err handle while probing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 10:00 +0200
  [PATCH 4.4 17/67] clk: qcom: msm8960: Fix ce3_src register offset Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 10:00 +0200
  [PATCH 4.4 15/67] clk: qcom: msm8960: fix ce3_core clk enable register Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 10:00 +0200
  Re: [PATCH 4.4 00/67] 4.4.10-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-09 10:10 +0200
  Re: [PATCH 4.4 00/67] 4.4.10-stable review Guenter Roeck <linux@roeck-us.net> - 2016-05-09 15:20 +0200
  Re: [PATCH 4.4 00/67] 4.4.10-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-05-09 21:50 +0200

csiph-web