[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Help debugging IPv6 SLAAC
From: |
thomasfogh |
Subject: |
[lwip-users] Help debugging IPv6 SLAAC |
Date: |
Thu, 19 Apr 2018 05:45:42 -0700 (MST) |
I've changed my IPv4 only application to be IPv6 only.
Right now it doesn't do anything but try to get an IPv6 address.
In wireshark I get:
No. Time Source Destination
Protocol Length Info
66 12:16:57,336514 :: ff02::1:ff01:23cc
ICMPv6 78 Neighbor Solicitation for fe80::250:e1ff:fe01:23cc
67 12:16:57,404247 :: ff02::2
ICMPv6 62 Router Solicitation
69 12:16:59,475989 fe80::250:e1ff:fe01:23cc ff02::2
ICMPv6 70 Router Solicitation from 00:50:e1:01:23:cc
71 12:17:00,603247 fe80::250:e1ff:fe01:23cc ff02::2
ICMPv6 70 Router Solicitation from 00:50:e1:01:23:cc
72 12:17:01,685189 fe80::250:e1ff:fe01:23cc ff02::2
ICMPv6 70 Router Solicitation from 00:50:e1:01:23:cc
Then nothing more happens and I can't ping the fe80::250:e1ff:fe01:23cc
address.
What am I missing?
I've changed the following to my lwipopts.h compared to my IPv4 app:
#define LWIP_IPV4 0
#define LWIP_IPV6 1
#define LWIP_NETIF_STATUS_CALLBACK 1
#define LWIP_ARP 0
#define LWIP_ETHERNET 1
#define LWIP_BROADCAST_PING 1
#define LWIP_MULTICAST_PING 1
Here's some of my code:
void lwip_init()
{
...
tcpip_init(NULL, NULL);
/* add the network interface */
netif_add(&netif, NULL, ethernetif_init, tcpip_input);
netif.ip6_autoconfig_enabled = 1;
netif_create_ip6_linklocal_address(&netif, 1);
netif_set_status_callback(&netif, mbedtls_net_status_callback);
/* register the default network interface. */
netif_set_default(&netif);
if (netif_is_link_up(&netif))
{
netif_set_up(&netif);
}
else
{
netif_set_down(&netif);
}
...
}
err_t ethernetif_init(struct netif *netif)
{
netif->name[0] = IFNAME0;
netif->name[1] = IFNAME1;
netif->output_ip6 = ethip6_output;
netif->linkoutput = low_level_output;
/* set netif MAC hardware address length */
netif->hwaddr_len = ETH_HWADDR_LEN;
/* set netif MAC hardware address */
netif->hwaddr[0] = MAC_ADDR0;
netif->hwaddr[1] = MAC_ADDR1;
netif->hwaddr[2] = MAC_ADDR2;
netif->hwaddr[3] = MAC_ADDR3;
netif->hwaddr[4] = MAC_ADDR4;
netif->hwaddr[5] = MAC_ADDR5;
/* set netif maximum transfer unit */
netif->mtu = 1500;
/* Accept broadcast address and ARP traffic */
netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP |
NETIF_FLAG_IGMP;
/* initialize the hardware */
low_level_init(netif);
return ERR_OK;
}
I've enabled some debug messages:
#define LWIP_DEBUG LWIP_DBG_ON
#define IP6_DEBUG LWIP_DBG_ON
#define ICMP_DEBUG LWIP_DBG_ON
#define NETIF_DEBUG LWIP_DBG_ON
#define INET_DEBUG LWIP_DBG_ON
#define IP_DEBUG LWIP_DBG_ON
#define TIMERS_DEBUG LWIP_DBG_ON
#define TCP_DEBUG LWIP_DBG_ON
#define TCP_INPUT_DEBUG LWIP_DBG_ON
#define TCP_OUTPUT_DEBUG LWIP_DBG_ON
#define TCPIP_DEBUG LWIP_DBG_ON
#define AUTOIP_DEBUG LWIP_DBG_ON
#define DNS_DEBUG LWIP_DBG_ON
#define ETHARP_DEBUG LWIP_DBG_ON
My log:
14:16:48.287 [RX] - Starting Main Thread...<CR><LF>
dns_init: initializing<LF>
14:16:50.050 [RX] - netif: added interface st IP<LF>
netif_ip6_addr_set_state: netif address state being changed<LF>
netif: IPv6 address 0 of interface st set to
FE80::250:E1FF:FE01:23CC/0x08<LF>
netif: setting default interface st<LF>
NETIF: st0 is UP<LF>
IPV6: Host at FE80::250:E1FF:FE01:23CC<LF>
inet_chksum_pseudo(): checksumming pbuf 0x20008a14 (has next 0x0) <LF>
inet_chksum_pseudo(): pbuf chain lwip_chksum()=c3ad<LF>
ip6_output_if: st0<LF>
IPv6 header:<LF>
+-------------------------------+<LF>
| 6 | 0 | 0 | (ver, class, flow)<LF>
+-------------------------------+<LF>
| 24 | 58 | 255 | (plen, nexth, hopl)<LF>
+-------------------------------+<LF>
| 0 | 0 | 0 | 0 | (src)<LF>
| 0 | 0 | 0 | 0 |<LF>
+-------------------------------+<LF>
| ff02 | 0 | 0 | 0 | (dest)<LF>
| 0 | 1 | ff01 | 23cc |<LF>
+-------------------------------+<LF>
netif->output_ip6()<LF>
ethernet_output: sending packet 0x20008a14<LF>
IP address = FE80::250:E1FF:FE01:23CC<LF>
14:16:57.411 [RX] - netif_ip6_addr_set_state: netif address state being
changed<LF>
netif: IPv6 address 0 of interface st set to
FE80::250:E1FF:FE01:23CC/0x09<LF>
inet_chksum_pseudo(): checksumming pbuf 0x20008a14 (has next 0x0) <LF>
inet_chksum_pseudo(): pbuf chain lwip_chksum()=4784<LF>
ip6_output_if: st0<LF>
IPv6 header:<LF>
+-------------------------------+<LF>
| 6 | 0 | 0 | (ver, class, flow)<LF>
+-------------------------------+<LF>
| 8 | 58 | 255 | (plen, nexth, hopl)<LF>
+-------------------------------+<LF>
| 0 | 0 | 0 | 0 | (src)<LF>
| 0 | 0 | 0 | 0 |<LF>
+-------------------------------+<LF>
| ff02 | 0 | 0 | 0 | (dest)<LF>
| 0 | 0 | 0 | 2 |<LF>
+-------------------------------+<LF>
netif->output_ip6()<LF>
ethernet_output: sending packet 0x20008a14<LF>
14:16:59.483 [RX] - netif_ip6_addr_set_state: netif address state being
changed<LF>
NETIF: st0 is UP<LF>
IPV6: Host at FE80::250:E1FF:FE01:23CC<LF>
netif: IPv6 address 0 of interface st set to
FE80::250:E1FF:FE01:23CC/0x30<LF>
inet_chksum_pseudo(): checksumming pbuf 0x20008a14 (has next 0x0) <LF>
inet_chksum_pseudo(): pbuf chain lwip_chksum()=d8f<LF>
ip6_output_if: st0<LF>
IPv6 header:<LF>
+-------------------------------+<LF>
| 6 | 0 | 0 | (ver, class, flow)<LF>
+-------------------------------+<LF>
| 16 | 58 | 255 | (plen, nexth, hopl)<LF>
+-------------------------------+<LF>
| fe80 | 0 | 0 | 0 | (src)<LF>
| 250 | e1ff | fe01 | 23cc |<LF>
+-------------------------------+<LF>
| ff02 | 0 | 0 | 0 | (dest)<LF>
| 0 | 0 | 0 | 2 |<LF>
+-------------------------------+<LF>
netif->output_ip6()<LF>
ethernet_output: sending packet 0x20008a14<LF>
14:17:00.610 [RX] - inet_chksum_pseudo(): checksumming pbuf 0x20008a14 (has
next 0x0) <LF>
inet_chksum_pseudo(): pbuf chain lwip_chksum()=d8f<LF>
ip6_output_if: st0<LF>
IPv6 header:<LF>
+-------------------------------+<LF>
| 6 | 0 | 0 | (ver, class, flow)<LF>
+-------------------------------+<LF>
| 16 | 58 | 255 | (plen, nexth, hopl)<LF>
+-------------------------------+<LF>
| fe80 | 0 | 0 | 0 | (src)<LF>
| 250 | e1ff | fe01 | 23cc |<LF>
+-------------------------------+<LF>
| ff02 | 0 | 0 | 0 | (dest)<LF>
| 0 | 0 | 0 | 2 |<LF>
+-------------------------------+<LF>
netif->output_ip6()<LF>
ethernet_output: sending packet 0x20008a14<LF>
14:17:01.693 [RX] - inet_chksum_pseudo(): checksumming pbuf 0x20008a14 (has
next 0x0) <LF>
inet_chksum_pseudo(): pbuf chain lwip_chksum()=d8f<LF>
ip6_output_if: st0<LF>
IPv6 header:<LF>
+-------------------------------+<LF>
| 6 | 0 | 0 | (ver, class, flow)<LF>
+-------------------------------+<LF>
| 16 | 58 | 255 | (plen, nexth, hopl)<LF>
+-------------------------------+<LF>
| fe80 | 0 | 0 | 0 | (src)<LF>
| 250 | e1ff | fe01 | 23cc |<LF>
+-------------------------------+<LF>
| ff02 | 0 | 0 | 0 | (dest)<LF>
| 0 | 0 | 0 | 2 |<LF>
+-------------------------------+<LF>
netif->output_ip6()<LF>
ethernet_output: sending packet 0x20008a14<LF>
14:17:27.416 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:17:58.166 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:17:58.916 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:17:59.666 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:18:30.287 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:18:41.227 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:18:50.417 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:18:51.186 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:18:51.936 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:18:52.672 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:18:53.442 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:18:54.192 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:20:01.340 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:20:02.106 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
14:20:02.856 [RX] - tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
tcpip_thread: PACKET 0x200098b0<LF>
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:e0:4c:68:00:c1, type:800<LF>
--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
- [lwip-users] Help debugging IPv6 SLAAC,
thomasfogh <=