[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] ipv6 support in existing lwip ipv4 code

From: Abhishek Verma
Subject: [lwip-users] ipv6 support in existing lwip ipv4 code
Date: Thu, 9 Jul 2020 21:10:42 +0530


I am working to support IPv6 in our current code which is running IPv4 on lwip. We are using a raw api approach.
Following is how I did network interface initialization for IPv6. Plz guide me if anything is missing here and if possible provide any reference of it.

ip_addr_t ip;
ipaddr_aton(str, &ip);  //str is IP address string it may be ipv4 or ipv6  
if(IP_IS_V6(&ip))      //for IPv6
  netif_create_ip6_linklocal_address(netif, 1);      // create link local address from MAC
  netif_ip6_addr_set(netif, 1, ip_2_ip6(&ip));
  netif_ip6_addr_set_state(netif, 0, IP6_ADDR_TENTATIVE);
  netif_ip6_addr_set_state(netif, 1, IP6_ADDR_PREFERRED);

Thanks in advance!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]