IPV6 Binding Failure Error: Cannot assign requested address
<ol>
<li><p>I  have configured Ubuntu Linux system with the following interfaces &amp; assigned IPV6 addresses as follows:</p>

<p><strong>Eth0</strong>:      Link encap:Ethernet  HWaddr 00:50:56:8d:57:64<br>
               inet addr:192.168.254.10  Bcast:0.0.0.0  Mask:255.255.255.0<br>
               inet6 addr: fe80::250:56ff:fe8d:5764/64 Scope:Link<br>
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br>
          RX packets:74231424 errors:0 dropped:1 overruns:0 frame:0<br>
          TX packets:400372550 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000<br>
          RX bytes:24514286488 (24.5 GB)  TX bytes:115992171490 (115.9 GB)</p>

<p><strong>Eth1</strong>:     Link encap:Ethernet  HWaddr 00:50:56:8d:7c:4c<br>
          inet addr:192.168.1.10  Bcast:0.0.0.0  Mask:255.255.255.0<br>
          inet6 addr: fe80::250:56ff:fe8d:7c4c/64 Scope:Link<br>
          inet6 addr: fc00:1234:1::10/120 Scope:Global<br>
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br>
          RX packets:434933479 errors:0 dropped:1 overruns:0 frame:0<br>
          TX packets:39666183 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000<br>
          RX bytes:126065364448 (126.0 GB)  TX bytes:14437801257 (14.4 GB)  </p>

<p><strong>Eth2</strong>:     Link encap:Ethernet  HWaddr 00:50:56:8d:56:14<br>
          inet addr:192.168.2.10  Bcast:0.0.0.0  Mask:255.255.255.0<br>
          inet6 addr: fc00:1234:2::10/120 Scope:Global<br>
          inet6 addr: fe80::250:56ff:fe8d:5614/64 Scope:Link<br>
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br>
          RX packets:480068741 errors:0 dropped:0 overruns:0 frame:0<br>
          TX packets:34145702 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000<br>
          RX bytes:146795537550 (146.7 GB)  TX bytes:10045338657 (10.0 GB) </p></li>
<li><p>I wanted to do Socket programming using IPV6 sockets. The code snippet that I have written is as follows:</p>

<p>struct sockaddr_in6 sin<br>
Ipv6_fdr = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP)  </p>

<p>bzero(&amp;sin, sizeof(sin));<br>
sin.sin6_family = AF_INET6;<br>
sin.sin6_port = htons(2152);<br>
      if ((setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &amp;opt, sizeof(int))) &lt; 0)<br>
memcpy(&amp;(sin.sin6_addr), "fc00:1234:1::10",sizeof(sin.sin6_addr));<br>
      if ((bind(sock, (struct sockaddr*)&amp;sin, sizeof(sin)))&lt; 0)  </p></li>
<li><p>After successful compilation, I’m getting IPV6 bind failure Error with the following error number &amp; name:<br>
<strong>EADDRNOTAVAIL   99  /* Cannot assign requested address</strong>.<br>
After certain number of attempts for IPV6 Binding it throws Segmentation Fault error.</p></li>
</ol>

<p>It would be great if someone could help me on what mistake I’m doing here &amp; why IPV6 binding is failing?</p>