rem: int core_udp_listen(struct in_addr *local_host, unsigned short local_port, int timeout)
add: static int core_udp_listen(netcat_sock *ncsock)
context: int core_udp_listen(struct in_addr *local_host, unsigned short local_port, int timeout){  int ret, sock;  struct sockaddr_in myaddr;  debug_v("core_udp_listen(local_host=%p, local_port=%hu)",	  (void *)local_host, local_port);  sock = netcat_socket_new(PF_INET, SOCK_DGRAM);  if (sock < 0)    return sock;  myaddr.sin_family = AF_INET;  myaddr.sin_port = htons(local_port);  if (local_host)    memcpy(&myaddr.sin_addr, local_host, sizeof(myaddr.sin_addr));  else    memset(&myaddr.sin_addr, 0, sizeof(myaddr.sin_addr));  ret = bind(sock, (struct sockaddr *)&myaddr, sizeof(myaddr));  if (ret < 0)    return -1;  else {    fd_set ins;    struct timeval tt;    tt.tv_usec = 0;    tt.tv_sec = timeout;    FD_ZERO(&ins);    FD_SET(sock, &ins);    select(sock + 1, &ins, NULL, NULL, (timeout > 0 ? &tt : NULL));    if (FD_ISSET(sock, &ins)) {      char buf[1];      struct sockaddr_in ix;      int slen = sizeof(ix);      ret = recvfrom(sock, buf, sizeof(buf), MSG_PEEK, (struct sockaddr *)&ix, &slen);      debug_v("received packet from %s:%d, using as default dest",	netcat_inet_ntop(&ix.sin_addr), ntohs(ix.sin_port));      connect(sock, (struct sockaddr *)&ix, slen);      /* connect and all */      return sock;    }  }  /* no packets until timeout */  return -1;  /* FIXME: this function is supposed to return a working I/O socket, which     this one is NOT. This means that we may want to recv() with MSG_PEEK     and then connect() it and then return, but this would require calling     select() although it's not a problem. */  return sock;}				/* end of core_udp_listen() */