summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/routing.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/routing.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/routing.c')
-rw-r--r--net/batman-adv/routing.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 9f933c95dc0e..939fc01371df 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -1012,8 +1012,9 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
1012 1012
1013 /* packet for me */ 1013 /* packet for me */
1014 if (batadv_is_my_mac(unicast_packet->dest)) { 1014 if (batadv_is_my_mac(unicast_packet->dest)) {
1015 batadv_interface_rx(recv_if->soft_iface, skb, recv_if, 1015 batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size,
1016 hdr_size); 1016 NULL);
1017
1017 return NET_RX_SUCCESS; 1018 return NET_RX_SUCCESS;
1018 } 1019 }
1019 1020
@@ -1050,7 +1051,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
1050 return NET_RX_SUCCESS; 1051 return NET_RX_SUCCESS;
1051 1052
1052 batadv_interface_rx(recv_if->soft_iface, new_skb, recv_if, 1053 batadv_interface_rx(recv_if->soft_iface, new_skb, recv_if,
1053 sizeof(struct batadv_unicast_packet)); 1054 sizeof(struct batadv_unicast_packet), NULL);
1054 return NET_RX_SUCCESS; 1055 return NET_RX_SUCCESS;
1055 } 1056 }
1056 1057
@@ -1137,7 +1138,8 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
1137 goto out; 1138 goto out;
1138 1139
1139 /* broadcast for me */ 1140 /* broadcast for me */
1140 batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size); 1141 batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size,
1142 orig_node);
1141 ret = NET_RX_SUCCESS; 1143 ret = NET_RX_SUCCESS;
1142 goto out; 1144 goto out;
1143 1145