From 5af128b21ea6faa7e245406021c20e05b9e9f33a Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Thu, 14 Dec 2000 23:35:57 +0000 Subject: [PATCH] Adapt to new struct kinfo_proc and unbreak world. Apologies to: darrenr who is maintainer --- contrib/ipfilter/ipsend/sock.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/ipfilter/ipsend/sock.c b/contrib/ipfilter/ipsend/sock.c index a998c90a925b..a64159226842 100644 --- a/contrib/ipfilter/ipsend/sock.c +++ b/contrib/ipfilter/ipsend/sock.c @@ -283,12 +283,21 @@ struct tcpiphdr *ti; return NULL; fd = (struct filedesc *)malloc(sizeof(*fd)); +#if defined( __FreeBSD_version) && __FreeBSD_version >= 500013 + if (KMCPY(fd, p->ki_fd, sizeof(*fd)) == -1) + { + fprintf(stderr, "read(%#lx,%#lx) failed\n", + (u_long)p, (u_long)p->ki_fd); + return NULL; + } +#else if (KMCPY(fd, p->kp_proc.p_fd, sizeof(*fd)) == -1) { fprintf(stderr, "read(%#lx,%#lx) failed\n", (u_long)p, (u_long)p->kp_proc.p_fd); return NULL; } +#endif o = (struct file **)calloc(1, sizeof(*o) * (fd->fd_lastfile + 1)); if (KMCPY(o, fd->fd_ofiles, (fd->fd_lastfile + 1) * sizeof(*o)) == -1)