aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2013-06-04 06:11:42 -0400
committerAntonio Quartulli <antonio@meshcoding.com>2013-10-19 11:27:11 -0400
commitbbb877ed777236669ed14b5957ae72117f3b3129 (patch)
tree99062ef24405c6ce30a0f64be226fa56e6798336 /net/batman-adv
parent1605278901718ed51b5c8c832d61b1009e556306 (diff)
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>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/gateway_client.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index a9209466ddaf..4ed410f73de4 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -726,7 +726,20 @@ bool batadv_gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len)
726 return true; 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 */
730bool batadv_gw_out_of_range(struct batadv_priv *bat_priv, 743bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
731 struct sk_buff *skb) 744 struct sk_buff *skb)
732{ 745{
@@ -737,6 +750,9 @@ bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
737 bool ret, out_of_range = false; 750 bool ret, out_of_range = false;
738 unsigned int header_len = 0; 751 unsigned int header_len = 0;
739 uint8_t curr_tq_avg; 752 uint8_t curr_tq_avg;
753 unsigned short vid;
754
755 vid = batadv_get_vid(skb, 0);
740 756
741 ret = batadv_gw_is_dhcp_target(skb, &header_len); 757 ret = batadv_gw_is_dhcp_target(skb, &header_len);
742 if (!ret) 758 if (!ret)
@@ -744,8 +760,7 @@ bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
744 760
745 ethhdr = (struct ethhdr *)skb->data; 761 ethhdr = (struct ethhdr *)skb->data;
746 orig_dst_node = batadv_transtable_search(bat_priv, ethhdr->h_source, 762 orig_dst_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
747 ethhdr->h_dest, 763 ethhdr->h_dest, vid);
748 BATADV_NO_FLAGS);
749 if (!orig_dst_node) 764 if (!orig_dst_node)
750 goto out; 765 goto out;
751 766