batman-adv: check incoming packet type for bla
If the gateway functionality is used, some broadcast packets (DHCP requests) may be transmitted as unicast packets. As the bridge loop avoidance code now only considers the payload Ethernet destination, it may drop the DHCP request for clients which are claimed by other backbone gateways, because it falsely infers from the broadcast address that the right backbone gateway should havehandled the broadcast. Fix this by checking and delegating the batman-adv packet type used for transmission. Reported-by: Guido Iribarren <guidoiribarren@buenosaireslibre.org> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
This commit is contained in:

committed by
Antonio Quartulli

parent
9e85a6f9dc
commit
2d3f6ccc4e
@@ -256,7 +256,11 @@ void interface_rx(struct net_device *soft_iface,
|
||||
struct bat_priv *bat_priv = netdev_priv(soft_iface);
|
||||
struct ethhdr *ethhdr;
|
||||
struct vlan_ethhdr *vhdr;
|
||||
struct batman_header *batadv_header = (struct batman_header *)skb->data;
|
||||
short vid __maybe_unused = -1;
|
||||
bool is_bcast;
|
||||
|
||||
is_bcast = (batadv_header->packet_type == BAT_BCAST);
|
||||
|
||||
/* check if enough space is available for pulling, and pull */
|
||||
if (!pskb_may_pull(skb, hdr_size))
|
||||
@@ -302,7 +306,7 @@ void interface_rx(struct net_device *soft_iface,
|
||||
/* Let the bridge loop avoidance check the packet. If will
|
||||
* not handle it, we can safely push it up.
|
||||
*/
|
||||
if (bla_rx(bat_priv, skb, vid))
|
||||
if (bla_rx(bat_priv, skb, vid, is_bcast))
|
||||
goto out;
|
||||
|
||||
netif_rx(skb);
|
||||
|
Reference in New Issue
Block a user