Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - getifaddrs gives wrong values for link-local ipv6 addresses.: (1 Item)
   
getifaddrs gives wrong values for link-local ipv6 addresses.  
Hi there,

   I have a program that gives me the list of ipv6 addresses on all the interfaces. The program is attached.

   If the interface has a link-local ipaddress say fe80::1/64, I get the ip address as fe80:21::1/64. This is same in 
case of fe80 fe90 fea0 and feb0 series ip addresses. I get the proper ip address for other series of ip addresses.

   The same code works fine on linux.

   When tested:
ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
ax0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 3c:18:a0:e0:09:11
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 192.168.30.100 netmask 0xffffff00 broadcast 192.168.30.255
        inet6 fe80::3e18:a0ff:fee0:911%ax0 prefixlen 64 tentative scopeid 0x20
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: f2:0b:a4:1b:6a:07
        media: Ethernet autoselect
        inet6 fe80::f00b:a4ff:fe1b:6a07%tap0 prefixlen 64 scopeid 0x21

./get_ip_adress
IP6 addr for lo0 : ::1
IP6 addr for lo0 : fe80:1::1
IP6 addr for ax0 : fe80:20::3e18:a0ff:fee0:911
IP6 addr for tap0 : fe80:21::f00b:a4ff:fe1b:6a07

Observe that after fe80 some junk values are added. Am I doing anything wrong in the program.

I am using qnx-neutrino 6.6 on imx6 board.
Attachment: Text get_ip6_addr.c 1.11 KB