mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-24 04:33:24 +00:00
- Replace previous patch with a better one.
Submitted by: Hajimu UMEMOTO <ume@FreeBSD.org> Approved by: Daniel Roethlisberger <daniel@roe.ch> (maintainer)
This commit is contained in:
parent
833191c2c5
commit
50edd7d663
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=232514
@ -1,33 +1,12 @@
|
||||
--- ncat/ncat_core.c.orig 2009-04-02 04:57:42.000000000 +0200
|
||||
+++ ncat/ncat_core.c 2009-04-16 14:12:39.000000000 +0200
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
+#include <sys/param.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -96,13 +97,22 @@
|
||||
rc = Snprintf(portbuf, sizeof(portbuf), "%hu", port);
|
||||
assert(rc >= 0 && rc < sizeof(portbuf));
|
||||
Index: ncat/ncat_core.c
|
||||
diff -u -p ncat/ncat_core.c.orig ncat/ncat_core.c
|
||||
--- ncat/ncat_core.c.orig 2009-04-02 11:57:42.000000000 +0900
|
||||
+++ ncat/ncat_core.c 2009-04-22 00:58:48.839927966 +0900
|
||||
@@ -89,6 +89,7 @@ int resolve(char *hostname, unsigned sho
|
||||
|
||||
+#if (defined(__FreeBSD_version) && (__FreeBSD_version < 800075) \
|
||||
+ && ((__FreeBSD_version > 800000) || (__FreeBSD_version < 702000)))
|
||||
+ rc = getaddrinfo(hostname, "domain", &hints, &result);
|
||||
+#else
|
||||
rc = getaddrinfo(hostname, portbuf, &hints, &result);
|
||||
+#endif
|
||||
if (rc != 0 || result == NULL)
|
||||
return 0;
|
||||
assert(result->ai_addrlen > 0 && result->ai_addrlen <= (int) sizeof(struct sockaddr_storage));
|
||||
*sslen = result->ai_addrlen;
|
||||
memcpy(ss, result->ai_addr, *sslen);
|
||||
freeaddrinfo(result);
|
||||
+#if (defined(__FreeBSD_version) && (__FreeBSD_version < 800075) \
|
||||
+ && ((__FreeBSD_version > 800000) || (__FreeBSD_version < 702000)))
|
||||
+ ((struct sockaddr_in *)ss)->sin_port = htons(port);
|
||||
+#endif
|
||||
return 1;
|
||||
}
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = o.af;
|
||||
+ hints.ai_socktype = SOCK_DGRAM;
|
||||
if (o.nodns)
|
||||
hints.ai_flags |= AI_NUMERICHOST;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user