diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-10-14 11:19:19 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-11-07 14:00:24 -0500 |
commit | 9affec6be810d1d529cb9dc95126119451696ba6 (patch) | |
tree | 0c81fbc5c19ca72926d242fa594756e26ee3aba9 /net/batman-adv/routing.c | |
parent | 4046b24aface62f5647699e9af3260a486bc5f49 (diff) |
batman-adv: enable fast client detection using unicast_4addr packets
The "early client detection mechanism" can be extended to find new clients by
means of unicast_4addr packets.
The unicast_4addr packet contains as well as the broadcast packet (which is
currently used in this mechanism) the address of the originating node and can
therefore be used to install new entries in the Global Translation Table
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r-- | net/batman-adv/routing.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 3f21c0905dde..32aa4d460e1f 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -986,6 +986,8 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, | |||
986 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 986 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
987 | struct batadv_unicast_packet *unicast_packet; | 987 | struct batadv_unicast_packet *unicast_packet; |
988 | struct batadv_unicast_4addr_packet *unicast_4addr_packet; | 988 | struct batadv_unicast_4addr_packet *unicast_4addr_packet; |
989 | uint8_t *orig_addr; | ||
990 | struct batadv_orig_node *orig_node = NULL; | ||
989 | int hdr_size = sizeof(*unicast_packet); | 991 | int hdr_size = sizeof(*unicast_packet); |
990 | bool is4addr; | 992 | bool is4addr; |
991 | 993 | ||
@@ -1005,9 +1007,12 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, | |||
1005 | 1007 | ||
1006 | /* packet for me */ | 1008 | /* packet for me */ |
1007 | if (batadv_is_my_mac(unicast_packet->dest)) { | 1009 | if (batadv_is_my_mac(unicast_packet->dest)) { |
1008 | if (is4addr) | 1010 | if (is4addr) { |
1009 | batadv_dat_inc_counter(bat_priv, | 1011 | batadv_dat_inc_counter(bat_priv, |
1010 | unicast_4addr_packet->subtype); | 1012 | unicast_4addr_packet->subtype); |
1013 | orig_addr = unicast_4addr_packet->src; | ||
1014 | orig_node = batadv_orig_hash_find(bat_priv, orig_addr); | ||
1015 | } | ||
1011 | 1016 | ||
1012 | if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, | 1017 | if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, |
1013 | hdr_size)) | 1018 | hdr_size)) |
@@ -1017,9 +1022,12 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, | |||
1017 | goto rx_success; | 1022 | goto rx_success; |
1018 | 1023 | ||
1019 | batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size, | 1024 | batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size, |
1020 | NULL); | 1025 | orig_node); |
1021 | 1026 | ||
1022 | rx_success: | 1027 | rx_success: |
1028 | if (orig_node) | ||
1029 | batadv_orig_node_free_ref(orig_node); | ||
1030 | |||
1023 | return NET_RX_SUCCESS; | 1031 | return NET_RX_SUCCESS; |
1024 | } | 1032 | } |
1025 | 1033 | ||