mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-06 22:51:41 +00:00
bcdd84a67f
No functional changes
41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
--- common.c.orig Wed Dec 15 06:39:03 1999
|
|
+++ common.c Wed Jul 19 10:09:32 2000
|
|
@@ -115,7 +115,7 @@
|
|
#endif
|
|
|
|
int
|
|
-server_socket (int port, int backlog)
|
|
+server_socket (struct in_addr addr, int port, int backlog)
|
|
{
|
|
struct sockaddr_in address;
|
|
int i, s;
|
|
@@ -131,9 +131,13 @@
|
|
strerror (errno));
|
|
}
|
|
|
|
+ memset(&address, '\0', sizeof address);
|
|
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
|
+ address.sin_len = sizeof address;
|
|
+#endif
|
|
address.sin_family = PF_INET;
|
|
address.sin_port = htons ((short)port);
|
|
- address.sin_addr.s_addr = INADDR_ANY;
|
|
+ address.sin_addr = addr;
|
|
|
|
if (bind (s, (struct sockaddr *)&address, sizeof (address)) == -1)
|
|
{
|
|
@@ -153,8 +157,12 @@
|
|
int
|
|
set_address (struct sockaddr_in *address, const char *host, int port)
|
|
{
|
|
+ memset(address, '\0', sizeof *address);
|
|
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
|
+ address->sin_len = sizeof *address;
|
|
+#endif
|
|
address->sin_family = PF_INET;
|
|
- address->sin_port = htons ((short)port);
|
|
+ address->sin_port = htons ((u_short)port);
|
|
address->sin_addr.s_addr = inet_addr (host);
|
|
|
|
if (address->sin_addr.s_addr == INADDR_NONE)
|