Seems strange though. Because I am using LWIP 2.1.2 and everything is working. Did you register a callback function as follows during your initialization?:
ppp_set_netif_statuscallback() ppp_set_netif_linkcallback() your netif_statuscallback should be triggered once the Router Advertisement comes in After the solicitation. That’s where you will see your full IPv6 address. After your pppObject = pppos_create() is successful, you need to do something like this… ppp_set_netif_statuscallback(pppObject, pppNetifStatusCB); Your callback should look something like this static void pppNetifStatusCB (struct netif *netif) { #if LWIP_IPV6 uint8_t i; #endif printf("\r\nCELL_PPP: PPP NETIF interface %s\r\n", netif_is_up(netif) ? "UP" : "DOWN"); #if LWIP_IPV6 // We've been notified that a change is about to take place on the interface. // Check if we now have a routable address instead of Link-local address only. for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { if (!ip_addr_isany(netif_ip_addr6(netif, i)) && !ip_addr_islinklocal(netif_ip_addr6(netif, i)) ) { Printf( " Unicast IPv6 Address: %s\r\n", ip6addr_ntoa(netif_ip6_addr(netif, i))); } } #endif } Your can send me snippet of what you are doing if you still have problem. I have tested this on both BG95 and BG96. ~Edman From: lwip-users <lwip-users-bounces+edmangzayzay=eaton....@nongnu.org> On Behalf Of Jiang Peng Sent: Friday, November 12, 2021 4:07 PM To: Mailing list for lwIP users <lwip-users@nongnu.org> Subject: Re: [lwip-users] [EXTERNAL] lwip IPV6 PPP only get link local address and cannot connect to server Thanks Edman That is the same place I added, but I don't see ipv6 address get through yet. I also tried 2.1.3 and still same. May I know anything missing? Thanks a lot for your help Ivan On Sat., 13 Nov. 2021, 1:08 am Zayzay, Edman G, <edmangzay...@eaton.com<mailto:edmangzay...@eaton.com>> wrote: Hi Ivan, When you get your callback indicating that the connection is up, that is when you need to send the router solicitation. See the example code below in the following link : https://github.com/particle-iot/lwip-contrib/blob/master/examples/ppp/pppos_example.c Look at line 96 – 98 #if PPP_IPV6_SUPPORT fprintf(stderr, " our6_ipaddr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(pppif, 0))); This is where you send Router Solicitation #endif /* PPP_IPV6_SUPPORT */ From: lwip-users <lwip-users-bounces+edmangzayzay=eaton....@nongnu.org<mailto:eaton....@nongnu.org>> On Behalf Of Jiang Peng Sent: Thursday, November 11, 2021 6:41 PM To: Mailing list for lwIP users <lwip-users@nongnu.org<mailto:lwip-users@nongnu.org>> Subject: Re: [lwip-users] [EXTERNAL] lwip IPV6 PPP only get link local address and cannot connect to server Hi Edman, Thanks a lot for the information. It appears that is the same issue I faced. I tried your suggestion, to add nd6_send_rs, but nothing happened, or I just add it in wrong place(I call it in ppposif.c). Could you please shed some light on how to send this rs? Upgrading to 2.1.3 may not be an option for me for now. thanks a lot Ivan On Fri, 12 Nov 2021 at 01:08, Zayzay, Edman G <edmangzay...@eaton.com<mailto:edmangzay...@eaton.com>> wrote: Hi Ivan, You need to explicitly send a router solicitation to the network in other to get the full IPv6 Address. The function to call is nd6_send_rs() in n6.c . However, this is a static function and you may have to create a wrapper to call it. As of yesterday, LWIP 2.1.3 was released and they now send RS automatically for IPv6. Hope this helps as I had the same issue 9 months ago. Edman From: lwip-users <lwip-users-bounces+edmangzayzay=eaton....@nongnu.org<mailto:eaton....@nongnu.org>> On Behalf Of Jiang Peng Sent: Wednesday, November 10, 2021 6:40 PM To: lwip-users@nongnu.org<mailto:lwip-users@nongnu.org> Subject: [EXTERNAL] [lwip-users] lwip IPV6 PPP only get link local address and cannot connect to server Hi everyone, I have a project that is running LwIP V2.1.2. The stack is LwIP on top of BG96 cellular modem. It works fine for IPV4, but when I enable IPV6, I only get IPV6 link local address, and cannot get real IPV6 address, therefore, I cannot connect to my server. The LwIP comes from ST cellular expansion package. I enable the log, and it got local and remote LL address, but after that never got any real address, and cannot connect to my server. thanks a lot for any hints or suggestions. thanks Ivan ////////////////////////////////////////////////////////////////////////////logs ////////////////////////////////////////////////////////////////////// 05.535 atcmd BG96:Activate PDN (user cid = 1, modem cid = 1) 05.542 atcmd BG96:MODEM SWITCHES TO DATA MODE 05.542 atcmd ATCore:<<< DATA MODE SELECTED >>> ppposif_client_confignetif: netmask of interface set to 255.255.255.255 netif: added interface pp IP addr 0.0.0.0 netmask 255.255.255.255 gw 0.0.0.0 ppp phase changed[0]: phase=0 netif: setting default interface pp netif: setting default interface pp client ppp_notify_phase_cb: PPP_PHASE_DEADppposif_client_dead: DC_SERVICE_OFF 06.035 iot_cell =====>CST_notif_callback (Data Cache event=0) ppp_connect[0]: holdoff=0 ppp phase changed[0]: phase=3 client ppp_notify_phase_cb: PPP_PHASE_INITIALIZEpppos_connect: unit 0: connecting ppp_start[0] ppp phase changed[0]: phase=6 pppos_send_config[0]: out_accm=FF FF FF FF ppp_send_config[0] pppos_recv_config[0]: in_accm=FF FF FF FF ppp_recv_config[0] ppp: auth protocols: PAP=0 pppos_write[0]: len=24 ppp_start[0]: finished pppos_input[0]: got 61 bytes pbuf_remove_header: old 0x24016058 new 0x2401605a (2) No auth is possible lcp_reqci: returning CONFREJ.pppos_write[0]: len=13 tcpip_inpkt: PACKET 0x24016258/0x2400eae8 pppos_input[0]: got 7 bytes pbuf_remove_header: old 0x24016058 new 0x2401605a (2) tcpip_inpkt: PACKET 0x24016258/0x2400eae8 pppos_input[0]: got 1 bytes tcpip_inpkt: PACKET 0x24016258/0x2400eae8 pppos_input[0]: got 44 bytes pbuf_remove_header: old 0x24016058 new 0x2401605a (2) lcp_reqci: returning CONFACK.pppos_write[0]: len=24 netif_set_mtu[0]: mtu=1500 pppos_send_config[0]: out_accm=0 0 0 0 ppp_send_config[0] pppos_recv_config[0]: in_accm=0 0 0 0 ppp_recv_config[0] ppp phase changed[0]: phase=7 07.031 iot_cell =====>CST_notif_callback (Data Cache event=2) 07.128 iot_cell =====>CST_notif_callback (Data Cache event=0) 07.128 iot_cell =====>CST_notif_callback (Data Cache event=1) 07.128 iot_cell -----> New State: CST_PPP_CONFIG_ON_GOING_STATE <----- 07.128 iot_cell ============ CST_cellular_service_task : autom_event = no event mtd_init.c +301 StartIoTTask Modem state is 18, ST Safe found ppp phase changed[0]: phase=9 pppos_input[0]: got 21 bytes ipv6cp: received interface identifier (fe80::1525:f2b1:ebca:3352) (ACK) ipv6cp: returning Configure-ACKpppos_write[0]: len=18 tcpip_inpkt: PACKET 0x24016258/0x2400eae8 pppos_input[0]: got 20 bytes pbuf_remove_header: old 0x24016058 new 0x2401605a (2) local LL address fe80::d823:7001:beb5:b051pppos_write[0]: len=18 tcpip_inpkt: PACKET 0x24016258/0x2400eae8 pppos_input[0]: got 1 bytes tcpip_inpkt: PACKET 0x24016258/0x2400eae8 pppos_input[0]: got 19 bytes pbuf_remove_header: old 0x24016058 new 0x2401605a (2) ipv6cp: upnetif_ip6_addr_set: netif address being changed netif: IPv6 address 0 of interface pp set to FE80::D823:7001:BEB5:B051/0x0hx netif_ip6_addr_set_state: netif address state being changed netif: IPv6 address 0 of interface pp set to FE80::D823:7001:BEB5:B051/0x0hx sif6up[0]: err_code=0 our_ipaddr = 0.0.0.0 his_ipaddr = 0.0.0.0 netmask = 255.255.255.255 dns1 = 8.8.8.8 dns2 = 8.8.4.4 our6_ipaddr = FE80::D823:7001:BEB5:B051 local LL address fe80::d823:7001:beb5:b051 remote LL address fe80::1525:f2b1:ebca:3352 ppp phase changed[0]: phase=10 -- Jiang Peng _______________________________________________ lwip-users mailing list lwip-users@nongnu.org<mailto:lwip-users@nongnu.org> https://lists.nongnu.org/mailman/listinfo/lwip-users -- Jiang Peng _______________________________________________ lwip-users mailing list lwip-users@nongnu.org<mailto:lwip-users@nongnu.org> https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users