Commit edbf12ba authored by Marek Lindner's avatar Marek Lindner Committed by Antonio Quartulli

batman-adv: ignore protocol packets if the interface did not enable this protocol

Reported-by: default avatarSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
Signed-off-by: default avatarAntonio Quartulli <ordex@autistici.org>
parent 7ae8b285
...@@ -1186,6 +1186,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, ...@@ -1186,6 +1186,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
static int bat_iv_ogm_receive(struct sk_buff *skb, static int bat_iv_ogm_receive(struct sk_buff *skb,
struct hard_iface *if_incoming) struct hard_iface *if_incoming)
{ {
struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct batman_ogm_packet *batman_ogm_packet; struct batman_ogm_packet *batman_ogm_packet;
struct ethhdr *ethhdr; struct ethhdr *ethhdr;
int buff_pos = 0, packet_len; int buff_pos = 0, packet_len;
...@@ -1196,6 +1197,12 @@ static int bat_iv_ogm_receive(struct sk_buff *skb, ...@@ -1196,6 +1197,12 @@ static int bat_iv_ogm_receive(struct sk_buff *skb,
if (!ret) if (!ret)
return NET_RX_DROP; return NET_RX_DROP;
/* did we receive a B.A.T.M.A.N. IV OGM packet on an interface
* that does not have B.A.T.M.A.N. IV enabled ?
*/
if (bat_priv->bat_algo_ops->bat_ogm_emit != bat_iv_ogm_emit)
return NET_RX_DROP;
packet_len = skb_headlen(skb); packet_len = skb_headlen(skb);
ethhdr = (struct ethhdr *)skb_mac_header(skb); ethhdr = (struct ethhdr *)skb_mac_header(skb);
packet_buff = skb->data; packet_buff = skb->data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment