Skip to content

Commit

Permalink
batman-adv: make the GW module correctly talk to the new VLAN-TT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Antonio Quartulli authored and Antonio Quartulli committed Oct 19, 2013
1 parent 1605278 commit bbb877e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions net/batman-adv/gateway_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,20 @@ bool batadv_gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len)
return true;
}

/* this call might reallocate skb data */
/**
* batadv_gw_out_of_range - check if the dhcp request destination is the best gw
* @bat_priv: the bat priv with all the soft interface information
* @skb: the outgoing packet
*
* Check if the skb is a DHCP request and if it is sent to the current best GW
* server. Due to topology changes it may be the case that the GW server
* previously selected is not the best one anymore.
*
* Returns true if the packet destination is unicast and it is not the best gw,
* false otherwise.
*
* This call might reallocate skb data.
*/
bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
struct sk_buff *skb)
{
Expand All @@ -737,15 +750,17 @@ bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
bool ret, out_of_range = false;
unsigned int header_len = 0;
uint8_t curr_tq_avg;
unsigned short vid;

vid = batadv_get_vid(skb, 0);

ret = batadv_gw_is_dhcp_target(skb, &header_len);
if (!ret)
goto out;

ethhdr = (struct ethhdr *)skb->data;
orig_dst_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
ethhdr->h_dest,
BATADV_NO_FLAGS);
ethhdr->h_dest, vid);
if (!orig_dst_node)
goto out;

Expand Down

0 comments on commit bbb877e

Please sign in to comment.