- Add more INET6 #ifdef's
- Suggested patch modified and extended PR: 35673 Submitted by: scheidell@secnap.net
This commit is contained in:
parent
76a31d626b
commit
fa10b7c0f8
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=55735
@ -1,6 +1,40 @@
|
|||||||
--- sshconnect.c.orig Wed Jul 25 16:35:18 2001
|
--- sshconnect.c.orig Mon Jan 21 16:13:51 2002
|
||||||
+++ sshconnect.c Wed Oct 3 12:42:20 2001
|
+++ sshconnect.c Fri Mar 8 18:14:50 2002
|
||||||
@@ -567,10 +567,12 @@
|
@@ -43,15 +43,21 @@
|
||||||
|
sockaddr_ntop(struct sockaddr *sa)
|
||||||
|
{
|
||||||
|
void *addr;
|
||||||
|
+#ifdef INET6
|
||||||
|
static char addrbuf[INET6_ADDRSTRLEN];
|
||||||
|
+#else
|
||||||
|
+ static char addrbuf[INET_ADDRSTRLEN];
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
switch (sa->sa_family) {
|
||||||
|
case AF_INET:
|
||||||
|
addr = &((struct sockaddr_in *)sa)->sin_addr;
|
||||||
|
break;
|
||||||
|
+#ifdef INET6
|
||||||
|
case AF_INET6:
|
||||||
|
addr = &((struct sockaddr_in6 *)sa)->sin6_addr;
|
||||||
|
break;
|
||||||
|
+#endif
|
||||||
|
default:
|
||||||
|
/* This case should be protected against elsewhere */
|
||||||
|
abort(); /* XXX abort is bad -- do something else */
|
||||||
|
@@ -291,7 +297,11 @@
|
||||||
|
/* Loop through addresses for this host, and try each one in
|
||||||
|
sequence until the connection succeeds. */
|
||||||
|
for (ai = aitop; ai; ai = ai->ai_next) {
|
||||||
|
+#ifdef INET6
|
||||||
|
if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
|
||||||
|
+#else
|
||||||
|
+ if (ai->ai_family != AF_INET)
|
||||||
|
+#endif
|
||||||
|
continue;
|
||||||
|
if (getnameinfo(ai->ai_addr, ai->ai_addrlen,
|
||||||
|
ntop, sizeof(ntop), strport, sizeof(strport),
|
||||||
|
@@ -537,10 +547,12 @@
|
||||||
local = (ntohl(((struct sockaddr_in *)hostaddr)->
|
local = (ntohl(((struct sockaddr_in *)hostaddr)->
|
||||||
sin_addr.s_addr) >> 24) == IN_LOOPBACKNET;
|
sin_addr.s_addr) >> 24) == IN_LOOPBACKNET;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user