*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.8 1997/02/07 06:27:19 deraadt Exp $";
+static char *rcsid = "$OpenBSD: svc_tcp.c,v 1.9 1997/02/13 22:21:11 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
+#include <netinet/ip_var.h>
/*
* Ops vector for TCP/IP based rpc service handle
#ifdef IP_OPTIONS
{
- u_char optbuf[BUFSIZ/3];
- int optsize = sizeof(optbuf), i;
+ struct ipoption opts;
+ int optsize = sizeof(opts), i;
- if (!getsockopt(sock, IPPROTO_IP, IP_OPTIONS, (char *)optbuf,
+ if (!getsockopt(sock, IPPROTO_IP, IP_OPTIONS, (char *)&opts,
&optsize) && optsize != 0) {
for (i = 0; i < optsize; ) {
- u_char c = optbuf[i];
+ u_char c = (u_char)opts.ipopt_list[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];
+ i += (c == IPOPT_NOP) ? 1 :
+ (u_char)opts.ipopt_list[i+1];
}
}
}
#ifndef lint
/* from: static char sccsid[] = "@(#)rlogind.c 8.1 (Berkeley) 6/4/93"; */
-static char *rcsid = "$Id: rlogind.c,v 1.16 1997/02/05 21:09:30 deraadt Exp $";
+static char *rcsid = "$Id: rlogind.c,v 1.17 1997/02/13 22:21:10 deraadt Exp $";
#endif /* not lint */
/*
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
+#include <netinet/ip_var.h>
#include <arpa/inet.h>
#include <netdb.h>
}
#ifdef IP_OPTIONS
{
- u_char optbuf[BUFSIZ/3];
- int optsize = sizeof(optbuf), ipproto, i;
+ struct ipoption opts;
+ int optsize = sizeof(opts), ipproto, i;
struct protoent *ip;
if ((ip = getprotobyname("ip")) != NULL)
ipproto = ip->p_proto;
else
ipproto = IPPROTO_IP;
- if (getsockopt(0, ipproto, IP_OPTIONS, (char *)optbuf,
+ if (getsockopt(0, ipproto, IP_OPTIONS, (char *)&opts,
&optsize) == 0 && optsize != 0) {
for (i = 0; i < optsize; ) {
- u_char c = optbuf[i];
+ u_char c = (u_char)opts.ipopt_list[i];
if (c == IPOPT_LSRR || c == IPOPT_SSRR)
exit(1);
if (c == IPOPT_EOL)
break;
- i += (c == IPOPT_NOP) ? 1 : optbuf[i+1];
+ i += (c == IPOPT_NOP) ? 1 :
+ (u_char)opts.ipopt_list[i+1];
}
}
}
#ifndef lint
/* from: static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; */
-static char *rcsid = "$Id: rshd.c,v 1.13 1997/02/05 21:09:29 deraadt Exp $";
+static char *rcsid = "$Id: rshd.c,v 1.14 1997/02/13 22:21:08 deraadt Exp $";
#endif /* not lint */
/*
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
+#include <netinet/ip_var.h>
#include <arpa/inet.h>
#include <netdb.h>
}
#ifdef IP_OPTIONS
{
- u_char optbuf[BUFSIZ/3];
- int optsize = sizeof(optbuf), ipproto, i;
+ struct ipoption opts;
+ int optsize = sizeof(opts), ipproto, i;
struct protoent *ip;
if ((ip = getprotobyname("ip")) != NULL)
ipproto = ip->p_proto;
else
ipproto = IPPROTO_IP;
- if (!getsockopt(0, ipproto, IP_OPTIONS, (char *)optbuf, &optsize) &&
+ if (!getsockopt(0, ipproto, IP_OPTIONS, (char *)&opts, &optsize) &&
optsize != 0) {
for (i = 0; i < optsize; ) {
- u_char c = optbuf[i];
+ u_char c = (u_char)opts.ipopt_list[i];
if (c == IPOPT_LSRR || c == IPOPT_SSRR)
exit(1);
if (c == IPOPT_EOL)
break;
- i += (c == IPOPT_NOP) ? 1 : optbuf[i+1];
+ i += (c == IPOPT_NOP) ? 1 : (u_char)opts.ipopt_list[i+1];
}
}
}