title: Filter UDP packets from a particular IP
body: <p>I have a program which transmits(broadcasts) and receives UDP packets simultaneously using pthreads. What I want to do is to remove packets which have been sent by me. How do I do that? My receive code currently looks as follows:</p>
  
  <pre><code>void *receive_thread_body(void *arg)
  {
    long msg = 0;
  
    while(msg&lt;500)
    {
      fd_set socket_set;
      FD_ZERO(&amp;socket_set);
      FD_SET(b_sock,&amp;socket_set);
      struct timeval tm;
      tm.tv_usec = 10;
      tm.tv_sec = 0;
  
      int ret = select(b_sock+1,&amp;socket_set,0,0,&amp;tm);
  
      if(ret == -1)
      {
        std::cout&lt;&lt;"select failed";
      }
  
      if(FD_ISSET(b_sock,&amp;socket_set) != 0)
      {
        int recvStringLen = recvfrom(b_sock, &amp;msg, sizeof(msg), 0, NULL, 0);
        if(recvStringLen &lt; 0)
        {
          std::cout&lt;&lt;"recvfrom failed";
        }
        else
        {
          printf("\t\t\tRX: %d\n",msg);
        }
      }
    }
  }
  </code></pre>