[SR-Users] listening at link local IPv6 address

Juha Heinanen jh at tutpro.com
Tue Apr 23 20:00:40 CEST 2019


Daniel-Constantin Mierla writes:

> Can you try without hard coding the IP address there, but use the value
> from the listen address? That will show if works properly with the
> config based values.

I tried like this:

  addr->sin6.sin6_scope_id =
    ipv6_get_netif_scope(sock_info->address_str.s);

and it failed:

Apr 23 20:45:12 salmon /usr/bin/sip-proxy[12701]: ERROR: <core> [core/udp_server.c:400]: udp_init(): bind(8, 0x7f88340f6fe4, 28) on FE80:0:0:0:6E29:95FF:FE7D:37E6: Invalid argument

Then I went and tried all these:

		addr->sin6.sin6_scope_id =
//			ipv6_get_netif_scope(sock_info->address_str.s);
//			ipv6_get_netif_scope("fe80::6e29:95ff:fe7d:37e6");
//			ipv6_get_netif_scope("fe80:0:0:0:6e29:95ff:fe7d:37e6");
			ipv6_get_netif_scope("fe80::6e29:95ff:fe7d:37e6");
//			ipv6_get_netif_scope("FE80::6E29:95FF:FE7D:37E6");

The only version that worked is the one not commented out.  So the
address needs to be exactly as shown by 'ip addr':

2: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 6c:29:95:7d:37:e6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.98/24 brd 192.168.43.255 scope global wlp1s0
       valid_lft forever preferred_lft forever
    inet6 fe80::6e29:95ff:fe7d:37e6/64 scope link 
       valid_lft forever preferred_lft forever

i.e., same case and omitting of zero fields.

It would be better to use the name of the interface (in above wlp1s0)
with call if_nametoindex(ifname).  Is the name available?

-- Juha



More information about the sr-users mailing list