diff options
Diffstat (limited to 'net/batman-adv/distributed-arp-table.c')
| -rw-r--r-- | net/batman-adv/distributed-arp-table.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index e96d7c745b4a..3e6b2624f980 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c | |||
| @@ -568,6 +568,7 @@ static void batadv_choose_next_candidate(struct batadv_priv *bat_priv, | |||
| 568 | * be sent to | 568 | * be sent to |
| 569 | * @bat_priv: the bat priv with all the soft interface information | 569 | * @bat_priv: the bat priv with all the soft interface information |
| 570 | * @ip_dst: ipv4 to look up in the DHT | 570 | * @ip_dst: ipv4 to look up in the DHT |
| 571 | * @vid: VLAN identifier | ||
| 571 | * | 572 | * |
| 572 | * An originator O is selected if and only if its DHT_ID value is one of three | 573 | * An originator O is selected if and only if its DHT_ID value is one of three |
| 573 | * closest values (from the LEFT, with wrap around if needed) then the hash | 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 | * Return: the candidate array of size BATADV_DAT_CANDIDATE_NUM. | 577 | * Return: the candidate array of size BATADV_DAT_CANDIDATE_NUM. |
| 577 | */ | 578 | */ |
| 578 | static struct batadv_dat_candidate * | 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 | int select; | 583 | int select; |
| 582 | batadv_dat_addr_t last_max = BATADV_DAT_ADDR_MAX, ip_key; | 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 | return NULL; | 594 | return NULL; |
| 593 | 595 | ||
| 594 | dat.ip = ip_dst; | 596 | dat.ip = ip_dst; |
| 595 | dat.vid = 0; | 597 | dat.vid = vid; |
| 596 | ip_key = (batadv_dat_addr_t)batadv_hash_dat(&dat, | 598 | ip_key = (batadv_dat_addr_t)batadv_hash_dat(&dat, |
| 597 | BATADV_DAT_ADDR_MAX); | 599 | BATADV_DAT_ADDR_MAX); |
| 598 | 600 | ||
| @@ -612,6 +614,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst) | |||
| 612 | * @bat_priv: the bat priv with all the soft interface information | 614 | * @bat_priv: the bat priv with all the soft interface information |
| 613 | * @skb: payload to send | 615 | * @skb: payload to send |
| 614 | * @ip: the DHT key | 616 | * @ip: the DHT key |
| 617 | * @vid: VLAN identifier | ||
| 615 | * @packet_subtype: unicast4addr packet subtype to use | 618 | * @packet_subtype: unicast4addr packet subtype to use |
| 616 | * | 619 | * |
| 617 | * This function copies the skb with pskb_copy() and is sent as unicast packet | 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 | static bool batadv_dat_send_data(struct batadv_priv *bat_priv, | 626 | static bool batadv_dat_send_data(struct batadv_priv *bat_priv, |
| 624 | struct sk_buff *skb, __be32 ip, | 627 | struct sk_buff *skb, __be32 ip, |
| 625 | int packet_subtype) | 628 | unsigned short vid, int packet_subtype) |
| 626 | { | 629 | { |
| 627 | int i; | 630 | int i; |
| 628 | bool ret = false; | 631 | bool ret = false; |
| @@ -631,7 +634,7 @@ static bool batadv_dat_send_data(struct batadv_priv *bat_priv, | |||
| 631 | struct sk_buff *tmp_skb; | 634 | struct sk_buff *tmp_skb; |
| 632 | struct batadv_dat_candidate *cand; | 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 | if (!cand) | 638 | if (!cand) |
| 636 | goto out; | 639 | goto out; |
| 637 | 640 | ||
| @@ -1022,7 +1025,7 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv, | |||
| 1022 | ret = true; | 1025 | ret = true; |
| 1023 | } else { | 1026 | } else { |
| 1024 | /* Send the request to the DHT */ | 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 | BATADV_P_DAT_DHT_GET); | 1029 | BATADV_P_DAT_DHT_GET); |
| 1027 | } | 1030 | } |
| 1028 | out: | 1031 | out: |
| @@ -1150,8 +1153,8 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv, | |||
| 1150 | /* Send the ARP reply to the candidates for both the IP addresses that | 1153 | /* Send the ARP reply to the candidates for both the IP addresses that |
| 1151 | * the node obtained from the ARP reply | 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); | 1156 | batadv_dat_send_data(bat_priv, skb, ip_src, vid, BATADV_P_DAT_DHT_PUT); |
| 1154 | batadv_dat_send_data(bat_priv, skb, ip_dst, 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 | /** |
