The following commit has been merged in the next branch: commit 1d9abd30f76cbc698c1ea9a9afc25cd9d912b63f Author: Marek Lindner lindner_marek@yahoo.de Date: Sun Jan 10 03:56:08 2010 +0000
batman-adv: best gw DHCP filter 802.1Q support
The DHCP filter inspects packets to determine whether or not to send them via ethernet unicast. This patch adds 802.1Q (vlan) support for this check.
Signed-off-by: Marek Lindner lindner_marek@yahoo.de [sven.eckelmann@gmx.de: Rework on top of current version] Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de
diff --git a/gateway_client.c b/gateway_client.c index 3d4e109..fde1d8a 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -415,6 +415,14 @@ int gw_is_target(struct bat_priv *bat_priv, struct sk_buff *skb) ethhdr = (struct ethhdr *)skb->data; header_len += ETH_HLEN;
+ /* check for initial vlan header */ + if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) { + if (!pskb_may_pull(skb, header_len + VLAN_HLEN)) + return 0; + ethhdr = (struct ethhdr *)(skb->data + VLAN_HLEN); + header_len += VLAN_HLEN; + } + /* check for ip header */ if (ntohs(ethhdr->h_proto) != ETH_P_IP) return 0;