title: Socket error:90:Message Too Long
body: <p>I have an error from the following scenario with IGMP socket call;</p>
  
  <pre><code>fd = socket(PF_INET,  SOCK_RAW, IPPROTO_IGMP) ;
  setsockopt( fd, IPPROTO_IP, IP_HDRINCL, nval, sizeof(nval) );
  /** Fill in the IP header and Ethernet header**/
  /*** Fill, create the IGMP packet structures***/
  if(sendto( fd, &amp;buf, sizeof(buf), 0,(struct sockaddr *) &amp;addr, sizeof(addr)) &lt; 0) {
      printf("Socket Sendto error %d : %s\n", errno, strerror(errno));
      return 0;
  }
  </code></pre>
  
  <p>the sendto call fails saying Message too long.
  I am using 8192 as the buffer size. So I tried using the following call to fix this error;</p>
  
  <pre><code>if(setsockopt(dlpifd, IPPROTO_IP, SO_SNDBUF, &amp;val, sizeof(int)) &lt; 0) {
     printf("Can't set socket options:%d:%s\n", errno, strerror(errno));
     return 0;`
  }
  </code></pre>
  
  <p>setsockopt( ) call succeeds but the same error for sendto();</p>
  
  <p>So i checked the SO_SNDBUF size with getsockopt( ) call and it shows 1 byte ?!</p>
  
  <p>What is wrong I am doing.</p>
  
  <p>Does the Linux kernel need recompile for IGMP support ? or I am missing something?</p>