@@ -568,6 +568,7 @@ static void batadv_choose_next_candidate(struct batadv_priv *bat_priv,
568
568
* be sent to
569
569
* @bat_priv: the bat priv with all the soft interface information
570
570
* @ip_dst: ipv4 to look up in the DHT
571
+ * @vid: VLAN identifier
571
572
*
572
573
* An originator O is selected if and only if its DHT_ID value is one of three
573
574
* closest values (from the LEFT, with wrap around if needed) then the hash
@@ -576,7 +577,8 @@ static void batadv_choose_next_candidate(struct batadv_priv *bat_priv,
576
577
* Return: the candidate array of size BATADV_DAT_CANDIDATE_NUM.
577
578
*/
578
579
static struct batadv_dat_candidate *
579
- batadv_dat_select_candidates (struct batadv_priv * bat_priv , __be32 ip_dst )
580
+ batadv_dat_select_candidates (struct batadv_priv * bat_priv , __be32 ip_dst ,
581
+ unsigned short vid )
580
582
{
581
583
int select ;
582
584
batadv_dat_addr_t last_max = BATADV_DAT_ADDR_MAX , ip_key ;
@@ -592,7 +594,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
592
594
return NULL ;
593
595
594
596
dat .ip = ip_dst ;
595
- dat .vid = 0 ;
597
+ dat .vid = vid ;
596
598
ip_key = (batadv_dat_addr_t )batadv_hash_dat (& dat ,
597
599
BATADV_DAT_ADDR_MAX );
598
600
@@ -612,6 +614,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
612
614
* @bat_priv: the bat priv with all the soft interface information
613
615
* @skb: payload to send
614
616
* @ip: the DHT key
617
+ * @vid: VLAN identifier
615
618
* @packet_subtype: unicast4addr packet subtype to use
616
619
*
617
620
* This function copies the skb with pskb_copy() and is sent as unicast packet
@@ -622,7 +625,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
622
625
*/
623
626
static bool batadv_dat_send_data (struct batadv_priv * bat_priv ,
624
627
struct sk_buff * skb , __be32 ip ,
625
- int packet_subtype )
628
+ unsigned short vid , int packet_subtype )
626
629
{
627
630
int i ;
628
631
bool ret = false;
@@ -631,7 +634,7 @@ static bool batadv_dat_send_data(struct batadv_priv *bat_priv,
631
634
struct sk_buff * tmp_skb ;
632
635
struct batadv_dat_candidate * cand ;
633
636
634
- cand = batadv_dat_select_candidates (bat_priv , ip );
637
+ cand = batadv_dat_select_candidates (bat_priv , ip , vid );
635
638
if (!cand )
636
639
goto out ;
637
640
@@ -1022,7 +1025,7 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
1022
1025
ret = true;
1023
1026
} else {
1024
1027
/* Send the request to the DHT */
1025
- ret = batadv_dat_send_data (bat_priv , skb , ip_dst ,
1028
+ ret = batadv_dat_send_data (bat_priv , skb , ip_dst , vid ,
1026
1029
BATADV_P_DAT_DHT_GET );
1027
1030
}
1028
1031
out :
@@ -1150,8 +1153,8 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
1150
1153
/* Send the ARP reply to the candidates for both the IP addresses that
1151
1154
* the node obtained from the ARP reply
1152
1155
*/
1153
- batadv_dat_send_data (bat_priv , skb , ip_src , BATADV_P_DAT_DHT_PUT );
1154
- batadv_dat_send_data (bat_priv , skb , ip_dst , BATADV_P_DAT_DHT_PUT );
1156
+ batadv_dat_send_data (bat_priv , skb , ip_src , vid , BATADV_P_DAT_DHT_PUT );
1157
+ batadv_dat_send_data (bat_priv , skb , ip_dst , vid , BATADV_P_DAT_DHT_PUT );
1155
1158
}
1156
1159
1157
1160
/**
0 commit comments