title: How to find whether an IP address is a link-local address or not
body: <p>I'm using <a href="https://stackoverflow.com/a/265978/1383698">this</a> program to find all IP addresses of my Debian machine. Although I can remove my loopback address by using the ifa_name field of the 'ifaddrs' structure, something like </p>
  
  <pre><code>  struct ifaddrs * ifAddrsStruct=NULL;
    getifaddrs(&amp;ifAddrsStruct);
    if (!strcmp(ifAddrIterator-&gt;ifa_name,"lo"))
     // Filter these addresses
  </code></pre>
  
  <p>I wanted to know is there any way I can find out, from the list of IP addresses, whether an IP address is a link-local (a network address that is intended and valid only for communications within a network segment) or not. Thanks in advance.  </p>