title: Raw Ethernet PF_PACKET issue on localhost
body: <p>I am working on raw ethernet programming in c. I have two files client and server  which are running on localhost. I am using my own protocol number for communication in socket().</p>
  
  <p>On the client side i have follwing code </p>
  
  <pre><code>    s = socket(PF_PACKET, SOCK_RAW, 61187);  
      unsigned char dest_mac[6]= {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};  
      struct sockaddr_ll socket_address;
  
          socket_address.sll_family   = PF_PACKET;
          socket_address.sll_protocol = 61187;
          socket_address.sll_ifindex  = ifindex;
          socket_address.sll_hatype   = ARPHRD_ETHER;
          socket_address.sll_pkttype  = PACKET_BROADCAST;
          socket_address.sll_halen    = ETH_ALEN;
          socket_address.sll_addr[0]  = dest_mac[0];
          socket_address.sll_addr[1]  = dest_mac[1];
          socket_address.sll_addr[2]  = dest_mac[2];
          socket_address.sll_addr[3]  = dest_mac[3];
          socket_address.sll_addr[4]  = dest_mac[4];
          socket_address.sll_addr[5]  = dest_mac[5];
          socket_address.sll_addr[6]  = 0x00;
          socket_address.sll_addr[7]  = 0x00;
  </code></pre>
  
  <p>and then i send some data as follows</p>
  
  <pre><code>sent = sendto(s, buffer, ETH_HEADER_LEN, 0, (struct sockaddr*)&amp;socket_address, sizeof(socket_address));
  </code></pre>
  
  <p>On the server side i do socket creation as in client and i am doing recvfrom as follows</p>
  
  <pre><code>length = recvfrom(s, buffer, BUF_SIZE, 0, NULL, NULL);
  </code></pre>
  
  <p>But i dont receive any packet on server side. Could anyone let me know what the problem is?</p>