]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
proxyarp: Print learned IPv6 address in debug log
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 25 Nov 2014 23:06:56 +0000 (01:06 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 25 Nov 2014 23:09:54 +0000 (01:09 +0200)
This makes it easier to debug issues related to IPv6 address snooping.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/ndisc_snoop.c

index 755621c565c044053240212c01cc3bc45ab3354e..39d15c7fb9093d4df2ca62fe28bcb5a4981d6c29 100644 (file)
@@ -89,6 +89,7 @@ static void handle_ndisc(void *ctx, const u8 *src_addr, const u8 *buf,
        struct in6_addr *saddr;
        struct sta_info *sta;
        int res;
+       char addrtxt[INET6_ADDRSTRLEN + 1];
 
        if (len < ETH_HLEN + sizeof(*msg))
                return;
@@ -110,6 +111,11 @@ static void handle_ndisc(void *ctx, const u8 *src_addr, const u8 *buf,
                        if (sta_has_ip6addr(sta, saddr))
                                return;
 
+                       if (inet_ntop(AF_INET6, saddr, addrtxt, sizeof(addrtxt))
+                           == NULL)
+                               addrtxt[0] = '\0';
+                       wpa_printf(MSG_DEBUG, "ndisc_snoop: Learned new IPv6 address %s for "
+                                  MACSTR, addrtxt, MAC2STR(sta->addr));
                        hostapd_drv_br_delete_ip_neigh(hapd, 6, (u8 *) saddr);
                        res = hostapd_drv_br_add_ip_neigh(hapd, 6, (u8 *) saddr,
                                                          128, sta->addr);