title: Why do we cast sockaddr_in to sockaddr when calling bind()?
body: <p>The <a href="http://linux.die.net/man/2/bind">bind()</a> function accepts a pointer to a <code>sockaddr</code>, but in all examples I've seen, a <code>sockaddr_in</code> structure is used instead, and is cast to <code>sockaddr</code>:</p>
  
  <pre><code>struct sockaddr_in name;
  ...
  if (bind (sock, (struct sockaddr *) &amp;name, sizeof (name)) &lt; 0)
  ...
  </code></pre>
  
  <p>I can't wrap my head around why is a <code>sockaddr_in</code> struct used. Why not just prepare and pass a <code>sockaddr</code>?</p>
  
  <p>Is it just convention?</p>