title: Linux kernel cannot receive multicast
body: <p>I built a Linux kernel with CONFIG_IP_MULTICAST=y,however no UDP multicast package received in this kernel while UDP unicast works well.</p>
  
  <pre><code>ethtool -S eth0 | grep multicast                         
  txmulticastframes_g: 0                   
  txmulticastframes_gb: 0             
  rxmulticastframes_g: 0
  </code></pre>
  
  <p>Any hints how can I solve this problem?</p>
  
  <p>Thx. Forrest G</p>
  
  <p>=================================================================================
  Additional:<br>
  tcpdump can get the packet</p>
  
  <pre><code>root@JHI # ./tcpdump port 3702
  device eth0 entered promiscuous mode
  tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
  listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
  -7:-48:-19.4151 IP 192.168.42.212.3702 &gt; 239.255.255.250.3702: UDP, length 787
  -7:-48:-19.4661 IP 192.168.42.212.3702 &gt; 239.255.255.250.3702: UDP, length 803
  ^C
  2 packets captured
  2 padevice eth0 left promiscuous mode
  ckets received by filter
  0 packets dropped by kernel
  </code></pre>
  
  <p>I write this WS-devicediscovery function with gSOAP. It works on X86 machine. When running on ARM device, it can send out igmp packet but not receive anything. </p>
  
  <pre><code>void wsdd()  
  {      
      struct soap *soap_udp;   
      struct ip_mreq mreq;   
  
      soap_udp=soap_new();  
      soap_init1(soap_udp, SOAP_IO_UDP|SOAP_IO_FLUSH);  
  
      if (!soap_valid_socket(soap_bind(soap_udp, NULL, 3702, 100)))  
      {      
          soap_print_fault(soap_udp, stderr);  
      }  
  
      mreq.imr_multiaddr.s_addr = inet_addr("239.255.255.250");  
      mreq.imr_interface.s_addr = htonl(INADDR_ANY);  
  
      if(setsockopt(soap_ud-&gt;master,IPPROTO_IP,IP_ADD_MEMBERSHIP,&amp;mreq,sizeof(mreq))==-1)     {  
          perror("membership error\n");  
      }
  
      int loop = 1;  
      int sock_opt = 1;
      if ((setsockopt(soap_udp-&gt;master, SOL_SOCKET, SO_REUSEADDR, (void *) &amp;sock_opt,  
                      sizeof (sock_opt))) == -1) {  
          printf("setsockopt\n");  
      }  
      if ((setsockopt(soap_udp-&gt;master, IPPROTO_IP, IP_MULTICAST_LOOP,  
                         &amp;loop, sizeof (loop))) == -1) {  
          printf("setsockopt\n");  
      }
  
      while(1){  
          soap_accept(soap_udp);
          soap_serve(soap_udp);   
          soap_end(soap_udp); 
      }  
  } 
  </code></pre>
  
  <p>Then I have tried these things but still not work</p>
  
  <pre><code>route add -net 224.0.0.0 netmask 240.0.0.0 eth0
  echo 0 &gt; /proc/sys/net/ipv4/conf/all/rp_filter
  </code></pre>