aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/soft-interface.c
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-07-05 17:38:30 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-08-23 08:20:22 -0400
commit371351731e9c2a7d8f4b169731495cb4f0589063 (patch)
treecd95307c7eb751c87c1f4baf9569b3aa70f414b4 /net/batman-adv/soft-interface.c
parent30cfd02b60e1cb16f5effb0a01f826c5bb7e4c59 (diff)
batman-adv: change interface_rx to get orig node
In order to understand where a broadcast packet is coming from and use this information to detect not yet announced clients, this patch modifies the interface_rx() function by passing a new argument: the orig node corresponding to the node that originated the received packet (if known). This new argument if not NULL for broadcast packets only (other packets does not have source field). Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/soft-interface.c')
-rw-r--r--net/batman-adv/soft-interface.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 03b0763abd2f..7b683e0bd668 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -270,7 +270,7 @@ end:
270 270
271void batadv_interface_rx(struct net_device *soft_iface, 271void batadv_interface_rx(struct net_device *soft_iface,
272 struct sk_buff *skb, struct batadv_hard_iface *recv_if, 272 struct sk_buff *skb, struct batadv_hard_iface *recv_if,
273 int hdr_size) 273 int hdr_size, struct batadv_orig_node *orig_node)
274{ 274{
275 struct batadv_priv *bat_priv = netdev_priv(soft_iface); 275 struct batadv_priv *bat_priv = netdev_priv(soft_iface);
276 struct ethhdr *ethhdr; 276 struct ethhdr *ethhdr;
@@ -322,6 +322,10 @@ void batadv_interface_rx(struct net_device *soft_iface,
322 322
323 soft_iface->last_rx = jiffies; 323 soft_iface->last_rx = jiffies;
324 324
325 if (orig_node)
326 batadv_tt_add_temporary_global_entry(bat_priv, orig_node,
327 ethhdr->h_source);
328
325 if (batadv_is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest)) 329 if (batadv_is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest))
326 goto dropped; 330 goto dropped;
327 331