my five cents about this.
Link local addresses generated using MAC address of NIC.
If server use VLAN interface, then server will have two or more NICs with same MAC address and two or more same IPv6 link local addresses.
In this case kamailio will bind to first NIC with this IPv6 address. When server use VLAN, then ipv6_get_netif_scope will give unexpected results.
Think need change this code
/* strip the interface name after */
for(i=0; ipaddr[i]; i++) {
if(ipaddr[i]=='%') {
ipaddr[i]='\0';
break;
}
}
/* if the ips matche, get scope index from interface name */
if(strcmp(ipaddr, ipval)==0){
iscope=if_nametoindex(netif->ifa_name);
goto done;
}