title: ARP reply sent by raw sockets ignored
body: <p>I am trying to add an entry to ARP table in ubuntu by responding to ARP request on network interface. </p>
  
  <p>I am capturing ARP requests with raw sockets, then I generate ARP reply and send it on the same interface. I can see my ARP reply in wireshark, but it is ignored and no ARP entry is added to ARP table and just another same ARP request is sent. <a href="http://imgur.com/pZvHpRG" rel="nofollow">Here is capture from wireshark.</a> When i turn wifi back on and router actually responds, it's accepted immidiately.</p>
  
  <p>Here is how i have set sockets sll:</p>
  
  <pre><code>struct sockaddr_ll sll;
  sll.sll_family = PF_PACKET;
  sll.sll_ifindex = ifr.ifr_ifindex;
  sll.sll_protocol = htons(ETH_P_ALL);
  for(int i=0;i&lt;6;i++)
      sll.sll_addr[i] = targetMAC[i];
  </code></pre>
  
  <p>and how I am sending packets:</p>
  
  <pre><code>sendto(sockfd, ARPreply, 60, 0, (struct sockaddr*)&amp;packet_info , sizeof(struct sockaddr_ll)) &lt; 0)
  </code></pre>
  
  <p>I really have no idea what is wrong. I know it should work, because i have done something similar on windows(using sparppcap). I tried messing with sll settings, but as i can see that packet is actually sent to network interface, i think problem may be somewhere else. Could it be that some linux settings prohibit handling packets send from the same pc or something like that?</p>
  
  <p>Thank you for any ideas</p>
  
  <p>Dreamo</p>
  
  <p>Edit 1:
  As requested, <a href="http://imgur.com/VlG227a" rel="nofollow">ARP frames content</a> (As they are not very long, i put them in one image) 
  The only difference between my generated reply and the one generated by router is source MAC address.</p>