title: raw ethernet sockets filling sockaddr_ll
body: <p>I am buliding a server/client software using PF_PACKET and SOCK_RAW and a custom protocol when calling socket()</p>
  
  <p>When in the client software I create the socket the same way and just do a rcvfrom that socket and I get the data</p>
  
  <p>My question is do I have to fill out the sockaddr_ll struct the same way I do for the server since when I reply from the client the source MAC address I got is a wierd one something like
  11:11:00:00:00:00 and of course this is not my client's MAC</p>
  
  <p>Does anyone know what this happens?
  Open the socket</p>
  
  <pre><code>if ( (sckfd=socket(PF_PACKET, SOCK_RAW, htons(proto)))&lt;0)
  {
      myError("socket");
  
  }
  </code></pre>
  
  <p>this is how I receive the data</p>
  
  <pre><code>n = recvfrom(sckfd, buffer, 2048, 0, NULL, NULL);
  printf("%d bytes read\n",n);
  </code></pre>
  
  <p>So this is how I basically receive the data in the client without filling the struct sockaddr_ll</p>
  
  <p>For the server Program I do have to fill the struct</p>
  
  <pre><code>struct sockaddr_ll saddrll;
  memset((void*)&amp;saddrll, 0, sizeof(saddrll));
  saddrll.sll_family = PF_PACKET;   
  saddrll.sll_ifindex = ifindex;
  saddrll.sll_halen = ETH_ALEN;
  memcpy((void*)(saddrll.sll_addr), (void*)dest, ETH_ALEN);
  </code></pre>
  
  <p>My question is I receive as shown and send as shown and when I reply to the server call the same function used in the server for Sending then what do I get 11:11:00:00:00:00 when receiving client replies </p>