diff options
author | shin <shin@FreeBSD.org> | 2000-01-25 14:52:10 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 2000-01-25 14:52:10 +0000 |
commit | fc29f7bcf7236935ba5c171ea553ac7dca533e8c (patch) | |
tree | 13e93b815761d57bc661099e5a2b7bcb2882b762 /lib/libc | |
parent | 4497b0fbabcff52472040173a4ea879ec212ecaa (diff) | |
download | FreeBSD-src-fc29f7bcf7236935ba5c171ea553ac7dca533e8c.zip FreeBSD-src-fc29f7bcf7236935ba5c171ea553ac7dca533e8c.tar.gz |
several tcp apps IPv6 update
-inetd
-rshd
-rlogind
-telnetd
-rsh
-rlogin
Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/Makefile.inc | 4 | ||||
-rw-r--r-- | lib/libc/net/rcmd.3 | 21 | ||||
-rw-r--r-- | lib/libc/net/rcmd.c | 13 |
3 files changed, 33 insertions, 5 deletions
diff --git a/lib/libc/net/Makefile.inc b/lib/libc/net/Makefile.inc index 87ac304..cde2734 100644 --- a/lib/libc/net/Makefile.inc +++ b/lib/libc/net/Makefile.inc @@ -58,7 +58,9 @@ MLINKS+=if_indextoname.3 if_nametoindex.3 if_indextoname.3 if_nameindex.3 \ if_indextoname.3 if_freenameindex.3 MLINKS+=linkaddr.3 link_addr.3 linkaddr.3 link_ntoa.3 #MLINKS+=ns.3 ns_addr.3 ns.3 ns_ntoa.3 -MLINKS+=rcmd.3 iruserok.3 rcmd.3 rresvport.3 rcmd.3 ruserok.3 +MLINKS+=rcmd.3 iruserok.3 rcmd.3 rresvport.3 rcmd.3 ruserok.3 \ + rcmd.3 iruserok_af.3 rcmd.3 rresvport_af.3 rcmd.3 ruserok_af.3 \ + rcmd.3 rcmd_af.3 MLINKS+=resolver.3 dn_comp.3 resolver.3 dn_expand.3 resolver.3 res_init.3 \ resolver.3 res_mkquery.3 resolver.3 res_query.3 \ resolver.3 res_search.3 resolver.3 res_send.3 diff --git a/lib/libc/net/rcmd.3 b/lib/libc/net/rcmd.3 index b00f94a..ed6478b 100644 --- a/lib/libc/net/rcmd.3 +++ b/lib/libc/net/rcmd.3 @@ -40,6 +40,7 @@ .Nm rresvport , .Nm iruserok , .Nm ruserok , +.Nm rcmd_af , .Nm rresvport_af , .Nm iruserok_af , .Nm ruserok_af @@ -55,7 +56,9 @@ .Ft int .Fn ruserok "const char *rhost" "int superuser" "const char *ruser" "const char *luser" .Ft int -.Fn rresvport_af "int *port" "int family" +.Fn rcmd_af "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p" "int af" +.Ft int +.Fn rresvport_af "int *port" "int af" .Ft int .Fn iruserok_af "void *raddr" "int superuser" "const char *ruser" "const char *luser" "int af" .Ft int @@ -184,17 +187,26 @@ It requires trusting the local DNS at most, while the function requires trusting the entire DNS, which can be spoofed. .Pp Functions with ``_af'' suffix, i.e. +.Fn rcmd_af , .Fn rresvport_af , -.Fn iruserok_af and +.Fn iruserok_af +and .Fn ruserok_af , works just as same as functions without ``_af'', and is capable of handling both IPv6 port and IPv4 port. +Functions without +.Dq Li _af +works for IPv4 only. To switch address family, .Fa af argument must be filled with -.Dv AF_INET +.Dv AF_INET , or .Dv AF_INET6 . +For +.Fn rcmd_af , +.Dv PF_UNSPEC +is also allowed. .Sh DIAGNOSTICS The .Fn rcmd @@ -230,6 +242,9 @@ functions appeared in .Fn rresvport_af appeared in RFC2292, and implemented by WIDE project for Hydrangea IPv6 protocol stack kit. +.Fn rcmd_af +appeared in draft-ietf-ipngwg-rfc2292bis-01.txt, +and implemented by WIDE/KAME IPv6 protocol stack kit. .Fn iruserok_af and .Fn rusreok_af diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index a1416ed..8130410 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -80,6 +80,17 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) const char *locuser, *remuser, *cmd; int *fd2p; { + return rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, AF_INET); +} + +int +rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af) + char **ahost; + u_short rport; + const char *locuser, *remuser, *cmd; + int *fd2p; + int af; +{ struct addrinfo hints, *res, *ai; struct sockaddr_storage from; fd_set reads; @@ -94,7 +105,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; + hints.ai_family = af; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; (void)snprintf(num, sizeof(num), "%d", ntohs(rport)); |