>
> do {
> from_len = sizeof(from);
> datalen = recvfrom(p->fd,buf,bufsize,0,&from,&from_len);
>
aehem, move from_len outside the "do" loop, it isn't wrong inside, but
not neccessary:
> from_len = sizeof(from);
> do {
> datalen = recvfrom(p->fd,buf,bufsize,0,&from,&from_len);
>