diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 1999-12-17 06:17:09 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 1999-12-17 06:17:09 +0000 |
commit | 4079660d028fd04257f79612e62b4e10cd975afe (patch) | |
tree | 1a3daed7c047fa6eadb26bb92a21c19a59895a62 /sys/netinet/ip_fil.c | |
parent | b44956e30be4e6576489a64e05343069fd07d608 (diff) |
Update to Darren Reed's IPFilter 3.3.5
Fixes: realaudio proxy issues, "log level" printing, and
source address for icmp replies (was reversed).
Thoughtfully submitted by techs@obfuscation.org
Diffstat (limited to 'sys/netinet/ip_fil.c')
-rw-r--r-- | sys/netinet/ip_fil.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/sys/netinet/ip_fil.c b/sys/netinet/ip_fil.c index 7885d41230e..45a71603e54 100644 --- a/sys/netinet/ip_fil.c +++ b/sys/netinet/ip_fil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_fil.c,v 1.27 1999/12/15 05:20:21 kjell Exp $ */ +/* $OpenBSD: ip_fil.c,v 1.28 1999/12/17 06:17:08 kjell Exp $ */ /* * Copyright (C) 1993-1998 by Darren Reed. * @@ -8,7 +8,7 @@ */ #if !defined(lint) static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: ip_fil.c,v 1.27 1999/12/15 05:20:21 kjell Exp $"; +static const char rcsid[] = "@(#)$Id: ip_fil.c,v 1.28 1999/12/17 06:17:08 kjell Exp $"; #endif #ifndef SOLARIS @@ -762,15 +762,15 @@ caddr_t data; } if (!f) { - if (req == SIOCINAFR || req == SIOCINIFR) { - ftail = fprev; - if (fp->fr_hits) { - while (--fp->fr_hits && (f = *ftail)) { + if (req != SIOCINAFR || req != SIOCINIFR) + while ((f = *ftail)) + ftail = &f->fr_next; + else { + if (fp->fr_hits) + while (--fp->fr_hits && (f = *ftail)) ftail = &f->fr_next; - } - } + f = NULL; } - f = NULL; } if (req == SIOCDELFR || req == SIOCRMIFR) { @@ -795,7 +795,7 @@ caddr_t data; error = EEXIST; else { if (unit == IPL_LOGAUTH) - return fr_auth_ioctl(data, req, f, ftail); + return fr_auth_ioctl(data, req, fp, ftail); KMALLOC(f, frentry_t *); if (f != NULL) { if (fg && fg->fg_head) @@ -1018,7 +1018,7 @@ int send_icmp_err(oip, type, code, ifp, dst) ip_t *oip; int type, code; void *ifp; -struct in_addr dst; +struct in_addr dst; { struct icmp *icmp; struct mbuf *m; @@ -1053,7 +1053,6 @@ struct in_addr dst; if (dst.s_addr == 0) { if (fr_ifpaddr(ifp, &dst) == -1) return -1; - dst.s_addr = htonl(dst.s_addr); } nip->ip_src = dst; nip->ip_dst = oip->ip_src; @@ -1320,19 +1319,9 @@ done: RTFREE(ro->ro_rt); return 0; bad: -# if BSD >= 199306 - if (error == EMSGSIZE) { - /* Send ICMP error here */ - struct mbuf *mcopy; - - mcopy = m_copy(m, 0, imin((int)ip->ip_len, 68)); - if (mcopy) { - mcopy->m_pkthdr.rcvif = (struct ifnet *)ifp; - icmp_error(mcopy, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, - ip->ip_dst.s_addr, ifp); - } - } -# endif + if (error == EMSGSIZE) + (void) send_icmp_err(ip, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, + ifp, ip->ip_dst); m_freem(m); goto done; } |