summaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2012-03-11 06:17:49 +0800
committerAntonio Quartulli <ordex@autistici.org>2012-05-11 13:55:59 +0200
commitedbf12ba56c4578f62a1357e005bcf11c2c38a16 (patch)
treec73a280a2905cf8f521fc8d0dd5d26104189f3e5 /net/batman-adv
parent7ae8b2852f946c71fdbd910156baa605a4ae3cee (diff)
downloadlinux-edbf12ba56c4578f62a1357e005bcf11c2c38a16.tar.gz
linux-edbf12ba56c4578f62a1357e005bcf11c2c38a16.tar.bz2
linux-edbf12ba56c4578f62a1357e005bcf11c2c38a16.zip
batman-adv: ignore protocol packets if the interface did not enable this protocol
Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/bat_iv_ogm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index ae0a08c391ea..37e368d05937 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -1186,6 +1186,7 @@ out:
static int bat_iv_ogm_receive(struct sk_buff *skb,
struct hard_iface *if_incoming)
{
+ struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct batman_ogm_packet *batman_ogm_packet;
struct ethhdr *ethhdr;
int buff_pos = 0, packet_len;
@@ -1196,6 +1197,12 @@ static int bat_iv_ogm_receive(struct sk_buff *skb,
if (!ret)
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);
ethhdr = (struct ethhdr *)skb_mac_header(skb);
packet_buff = skb->data;