title: recvfrom() not filling the from IP address even for UDP messages in first call
body: <p>I am using recvfrom() to get the UDP datagram into my buffer and passing non-NULL from_addr structure &amp; len argument expecting it to get the source IP. But for the first call, they are NULL.
  Subsequent calls are filling the addr structure and len field. Is this expected ?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  #include &lt;sys/socket.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;netinet/in.h&gt;
  
  
  int
  main()
  {
      struct  sockaddr_in myaddr, from_addr;
      char    from_ip[1024] = "", myip[2014] = "";
      char    rmsg[1024 * 1024] = "";
      int     sock_fd=-1,nbytes=0;
      int     len=0;
      unsigned short port=0;
  
      sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
      if(sock_fd == -1)
      {
          perror("Socket");
          return -1;
      }
  
      printf("IP Addr &amp; Port to bound to :");
      scanf("%s%u", myip, &amp;port);
  
      myaddr.sin_family = AF_INET;
      myaddr.sin_port = htons(port);
      inet_pton(AF_INET, myip, &amp;myaddr.sin_addr);
  
      printf("Bound to %s:%u\n", myip, htons(port));
  
      nbytes = bind(sock_fd, &amp;myaddr, sizeof(myaddr));
      if(nbytes == -1)
      {
          perror("Bind");
          return -1;
      }
  
      do
      {
          /**/nbytes = recvfrom(sock_fd, rmsg, sizeof(rmsg), 0, &amp;from_addr, &amp;len);/**/
          inet_ntop(AF_INET, &amp;from_addr.sin_addr, from_ip, sizeof(from_ip));
  
          printf("Received %d bytes from %s@%d : %s\n", nbytes, from_ip, ntohs(from_addr.sin_port), rmsg);
  
          if(strcmp(rmsg, "Bye") == 0)
          {
              printf("Client Disconnected.\n");
          }
          memset(rmsg, 0, sizeof(rmsg));
      }while(1);
  
      return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>-------------------------------OutPut -----------------------------------------
  root@ubuntu:/home/akumarkk/Desktop/distributedComp_Project/test# ./userver 
  IP Addr &amp; Port to bound to :127.0.0.1 12
  Bound to 127.0.0.1:3072
  Received 2 bytes from 0.0.0.0@0 : hi
  Received 6 bytes from 127.0.0.1@49511 : second
  Received 7 bytes from 127.0.0.1@49511 : message
  Received 3 bytes from 127.0.0.1@49511 : Bye
  Client Disconnected.
  </code></pre>