From 834ef5624421dfdb4665012ea43aa37d092efe40 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 24 Feb 1998 17:59:34 +0000 Subject: nmbd_incomingdgrams.c: Fix for typo. nmbd_sendannounce.c: Remote announcement was announcing to the wrong name ! nmblookup.c: Fix for substitutions not seeing hostname. testparm.c: Fix for substitutions not seeing hostname. wsmbstatus.c: Fix for substitutions not seeing hostname. util.c: Change read_udp_socket to use sockaddr_in rather than dubiously messing around with an opaque data type (sockaddr). Jeremy. (This used to be commit 776ccf5c0641b5aa300236c2612b5f2761d1179f) --- source3/lib/util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index 365a765174..18614caeed 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2002,20 +2002,20 @@ read from a socket int read_udp_socket(int fd,char *buf,int len) { int ret; - struct sockaddr sock; + struct sockaddr_in sock; int socklen; socklen = sizeof(sock); bzero((char *)&sock,socklen); bzero((char *)&lastip,sizeof(lastip)); - ret = recvfrom(fd,buf,len,0,&sock,&socklen); + ret = recvfrom(fd,buf,len,0,(struct sockaddr *)&sock,&socklen); if (ret <= 0) { DEBUG(2,("read socket failed. ERRNO=%s\n",strerror(errno))); return(0); } - lastip = *(struct in_addr *) &sock.sa_data[2]; - lastport = ntohs(((struct sockaddr_in *)&sock)->sin_port); + lastip = sock.sin_addr; + lastport = ntohs(sock.sin_port); DEBUG(10,("read_udp_socket: lastip %s lastport %d read: %d\n", inet_ntoa(lastip), lastport, ret)); -- cgit