b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: ignore protocol packets if the interface did not enable this protocol
@ 2012-03-10 22:17 Marek Lindner
  2012-03-10 22:17 ` [B.A.T.M.A.N.] [PATCH 2/5] batman-adv: refactoring API: find generalized name for bat_ogm_update_mac callback Marek Lindner
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Marek Lindner @ 2012-03-10 22:17 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 bat_iv_ogm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index eca2b44..819ae49 100644
--- a/bat_iv_ogm.c
+++ b/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,11 @@ 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;
-- 
1.7.9.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-03-15  6:50 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-10 22:17 [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: ignore protocol packets if the interface did not enable this protocol Marek Lindner
2012-03-10 22:17 ` [B.A.T.M.A.N.] [PATCH 2/5] batman-adv: refactoring API: find generalized name for bat_ogm_update_mac callback Marek Lindner
2012-03-15  6:44   ` Marek Lindner
2012-03-10 22:17 ` [B.A.T.M.A.N.] [PATCH 3/5] batman-adv: rename sysfs macros to reflect the soft-interface dependency Marek Lindner
2012-03-15  6:46   ` Marek Lindner
2012-03-10 22:17 ` [B.A.T.M.A.N.] [PATCH 4/5] batman-adv: Adding hard_iface specific sysfs wrapper macros for UINT Marek Lindner
2012-03-15  6:48   ` Marek Lindner
2012-03-10 22:17 ` [B.A.T.M.A.N.] [PATCH 5/5] batman-adv: avoid temporary routing loops by being strict on forwarded OGMs Marek Lindner
2012-03-11 21:50   ` Simon Wunderlich
2012-03-12  7:24     ` Daniele Furlan
2012-03-12  7:41       ` Marek Lindner
2012-03-12  7:49         ` Daniele Furlan
2012-03-12  7:55           ` Marek Lindner
2012-03-12  8:23             ` Daniele Furlan
2012-03-12  8:36               ` Marek Lindner
2012-03-15  6:50   ` Marek Lindner
2012-03-15  6:43 ` [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: ignore protocol packets if the interface did not enable this protocol Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).