Commit bbb877ed777236669ed14b5957ae72117f3b3129
Committed by
Antonio Quartulli
1 parent
1605278901
batman-adv: make the GW module correctly talk to the new VLAN-TT
The gateway code is now adapted in order to correctly interact with the Translation Table component by using the vlan ID Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Showing 1 changed file with 18 additions and 3 deletions Side-by-side Diff
net/batman-adv/gateway_client.c
... | ... | @@ -726,7 +726,20 @@ |
726 | 726 | return true; |
727 | 727 | } |
728 | 728 | |
729 | -/* this call might reallocate skb data */ | |
729 | +/** | |
730 | + * batadv_gw_out_of_range - check if the dhcp request destination is the best gw | |
731 | + * @bat_priv: the bat priv with all the soft interface information | |
732 | + * @skb: the outgoing packet | |
733 | + * | |
734 | + * Check if the skb is a DHCP request and if it is sent to the current best GW | |
735 | + * server. Due to topology changes it may be the case that the GW server | |
736 | + * previously selected is not the best one anymore. | |
737 | + * | |
738 | + * Returns true if the packet destination is unicast and it is not the best gw, | |
739 | + * false otherwise. | |
740 | + * | |
741 | + * This call might reallocate skb data. | |
742 | + */ | |
730 | 743 | bool batadv_gw_out_of_range(struct batadv_priv *bat_priv, |
731 | 744 | struct sk_buff *skb) |
732 | 745 | { |
733 | 746 | |
734 | 747 | |
... | ... | @@ -737,15 +750,17 @@ |
737 | 750 | bool ret, out_of_range = false; |
738 | 751 | unsigned int header_len = 0; |
739 | 752 | uint8_t curr_tq_avg; |
753 | + unsigned short vid; | |
740 | 754 | |
755 | + vid = batadv_get_vid(skb, 0); | |
756 | + | |
741 | 757 | ret = batadv_gw_is_dhcp_target(skb, &header_len); |
742 | 758 | if (!ret) |
743 | 759 | goto out; |
744 | 760 | |
745 | 761 | ethhdr = (struct ethhdr *)skb->data; |
746 | 762 | orig_dst_node = batadv_transtable_search(bat_priv, ethhdr->h_source, |
747 | - ethhdr->h_dest, | |
748 | - BATADV_NO_FLAGS); | |
763 | + ethhdr->h_dest, vid); | |
749 | 764 | if (!orig_dst_node) |
750 | 765 | goto out; |
751 | 766 |