Patch to initialize sockaddr by Jarda Benkovsky.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@@ -57,6 +58,7 @@ sock_create_inet_socket (char * addr, unsigned int port)
|
|||||||
|
|
||||||
/* Give the socket a name. */
|
/* Give the socket a name. */
|
||||||
//debug("Binding Inet Socket\n");
|
//debug("Binding Inet Socket\n");
|
||||||
|
memset (&name, 0, sizeof (name));
|
||||||
name.sin_family = AF_INET;
|
name.sin_family = AF_INET;
|
||||||
name.sin_port = htons (port);
|
name.sin_port = htons (port);
|
||||||
inet_aton(addr, &name.sin_addr);
|
inet_aton(addr, &name.sin_addr);
|
||||||
|
|||||||
Reference in New Issue
Block a user