*/
#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 */
/*
#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
*/
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.
close(sock);
goto again;
}
+
/*
* make a new transporter (re-uses xprt)
*/