diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-07 06:27:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-07 06:27:20 +0000 |
commit | a384d507e7ae5f970a995b384dffda7dbc7b201a (patch) | |
tree | b304a64cdf0e2c2174d91b8366e9004a15cbbac5 /lib/libc | |
parent | 4adf5e1ea6afb967ddfa4424a937c15e091ff561 (diff) |
destroy everything with source routes
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/svc_tcp.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c index e9bf8d440b0..0fac0993df6 100644 --- a/lib/libc/rpc/svc_tcp.c +++ b/lib/libc/rpc/svc_tcp.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.7 1996/08/20 23:47:46 deraadt Exp $"; +static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.8 1997/02/07 06:27:19 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -49,6 +49,10 @@ static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.7 1996/08/20 23:47:46 deraadt Exp #include <sys/socket.h> #include <errno.h> +#include <netinet/in_systm.h> +#include <netinet/in.h> +#include <netinet/ip.h> + /* * Ops vector for TCP/IP based rpc service handle */ @@ -241,6 +245,28 @@ rendezvous_request(xprt) goto again; return (FALSE); } + +#ifdef IP_OPTIONS + { + u_char optbuf[BUFSIZ/3]; + int optsize = sizeof(optbuf), i; + + if (!getsockopt(sock, IPPROTO_IP, IP_OPTIONS, (char *)optbuf, + &optsize) && optsize != 0) { + for (i = 0; i < optsize; ) { + u_char c = optbuf[i]; + if (c == IPOPT_LSRR || c == IPOPT_SSRR) { + close(sock); + goto again; + } + if (c == IPOPT_EOL) + break; + i += (c == IPOPT_NOP) ? 1 : optbuf[i+1]; + } + } + } +#endif + /* * XXX careful for ftp bounce attacks. If discovered, close the * socket and look for another connection. @@ -249,6 +275,7 @@ rendezvous_request(xprt) close(sock); goto again; } + /* * make a new transporter (re-uses xprt) */ |