[SR-Users] listening at link local IPv6 address

Juha Heinanen jh at tutpro.com
Mon Apr 22 09:11:44 CEST 2019


I read K source code and found these kind of lines in sock_info.c:

			for(;RTA_OK(rtap, rtl);rtap=RTA_NEXT(rtap,rtl)){
				switch(rtap->rta_type){
					case IFA_ADDRESS:
						if((*(int*)RTA_DATA(rtap))== htons(0xfe80)){
							LM_DBG("Link Local Address, ignoring ...\n");
							is_link_local = 1;
							break;
						}

and

					case IFA_LOCAL:
						if((*(int*)RTA_DATA(rtap))== htons(0xfe80)){
							LM_DBG("Link Local Address, ignoring ...\n");
							is_link_local = 1;
						}

and

			if(is_link_local) {
				pkg_free(entry);
				continue;    /* link local addresses are not bindable */
			}

The last comment is wrong.  Link local addresses ARE bindable.  They
just require that sin6_scope_id is set.

I made an experiment by setting sin6_scope_id scope_id in udp_server.c
like this:

	} else if (addr->s.sa_family==AF_INET6){
        ...
		addr->sin6.sin6_scope_id = if_nametoindex("wlp1s0");

and looks like it worked.  The error message was gone and

  listen=udp:[fe80::6e29:95ff:fe7d:37e6]:5060

produced:

  Apr 22 09:44:37 salmon sip-proxy[14003]: Listening on udp: FE80:0:0:0:6E29:95FF:FE7D:37E6 [FE80:0:0:0:6E29:95FF:FE7D:37E6]:5060

-- Juha



More information about the sr-users mailing list