[SR-Users] listening at link local IPv6 address
Juha Heinanen
jh at tutpro.com
Tue Apr 23 07:16:06 CEST 2019
Daniel-Constantin Mierla writes:
> Anyhow, your code has hardcoded interface name, I added a helper
> function that tries to get the scope by matching the ip address when
> walking over network interfaces. The commit:
>
> https://github.com/kamailio/kamailio/commit/ce1138d2d8962296de2867d5751abf770b035da3
>
> Can you try using that function to get the scope id?
I tried by changing my udp_server.c test line:
addr->sin6.sin6_scope_id = if_nametoindex("wlp1s0");
to
addr->sin6.sin6_scope_id = addr->ipv6_get_netif_scope("fe80::6e29:95ff:fe7d:37e6");
and the test again worked fine:
Apr 23 08:10:41 salmon sip-proxy[21888]: Listening on
Apr 23 08:10:41 salmon sip-proxy[21888]: udp: FE80:0:0:0:6E29:95FF:FE7D:37E6 [FE80:0:0:0:6E29:95FF:FE7D:37E6]:5060
So rather than skipping link local addresses, ipv6_get_netif_scope could
be used to find the scope id.
-- Juha
More information about the sr-users
mailing list