Identifying the preferred IPv6 source address for an adapter
If you have a IPv6 enabled host that has more than one global-scope address, how can you programmatically identify the preferred address for bind() ? Example address list: eth0 Link encap:Ethernet HWaddr 00:14:5e:bd:6d:da inet addr:10.6.28.31 Bcast:10.6.28.255 Mask:255.255.255.0 inet6 addr: 2002:dce8:d28e:0:214:5eff:febd:6dda/64 Scope:Global inet6 addr: fe80::214:5eff:febd:6dda/64 Scope:Link inet6 addr: 2002:dce8:d28e::31/64 Scope:Global UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 On Solaris you can indicate a preferred address with an interface flag and it is available programmatically