getlocaladdr(struct sockaddr *remote)
{
struct sockaddr_storage *local;
- u_int local_len = sizeof(struct sockaddr);
+ u_int local_len = sizeof(struct sockaddr_storage);
int s; /* for dummy connection */
/* allocate buffer */
cm = (struct cmsghdr *)cmsgbuf;
m.msg_control = (caddr_t)cm;
m.msg_controllen = sizeof(cmsgbuf);
+ m.msg_flags = 0;
while ((len = recvmsg(s, &m, flags)) < 0) {
if (errno == EINTR)
continue;