diff options
author | Geoff Rehmet <csgr@FreeBSD.org> | 1999-08-19 05:22:12 +0000 |
---|---|---|
committer | Geoff Rehmet <csgr@FreeBSD.org> | 1999-08-19 05:22:12 +0000 |
commit | 828b7f4069278ebeb77e17df54c7f48f69bc8aad (patch) | |
tree | 31c09fd6a9386623ef7460ae01c2dc5bca7a7b00 /sys/netinet | |
parent | 43d79ae9efc313271892f3a62c6e022c6d3d3a6a (diff) | |
download | src-828b7f4069278ebeb77e17df54c7f48f69bc8aad.tar.gz src-828b7f4069278ebeb77e17df54c7f48f69bc8aad.zip |
Fix breakage if blackhole=1 and tiflags & TH_SYN, plus
style(9) fixes
Submitted by: Jonathon Lemon
Notes
Notes:
svn path=/head/; revision=50043
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_input.c | 19 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 19 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 4 |
3 files changed, 26 insertions, 16 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index af31149aed94..e0236b063f81 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $Id: tcp_input.c,v 1.88 1999/08/17 12:17:52 csgr Exp $ + * $Id: tcp_input.c,v 1.89 1999/08/18 15:40:05 csgr Exp $ */ #include "opt_ipfw.h" /* for ipfw_fwd */ @@ -421,14 +421,19 @@ findpcb: if (badport_bandlim(1) < 0) goto drop; #endif - if(blackhole) { + if (blackhole) { switch (blackhole) { - case 1: if(tiflags & TH_SYN) goto drop; - case 2: goto drop ; - default : goto drop ; + case 1: + if (tiflags & TH_SYN) + goto drop; + break; + case 2: + goto drop; + default: + goto drop; } - } else - goto dropwithreset; + } + goto dropwithreset; } tp = intotcpcb(inp); if (tp == 0) diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index af31149aed94..e0236b063f81 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $Id: tcp_input.c,v 1.88 1999/08/17 12:17:52 csgr Exp $ + * $Id: tcp_input.c,v 1.89 1999/08/18 15:40:05 csgr Exp $ */ #include "opt_ipfw.h" /* for ipfw_fwd */ @@ -421,14 +421,19 @@ findpcb: if (badport_bandlim(1) < 0) goto drop; #endif - if(blackhole) { + if (blackhole) { switch (blackhole) { - case 1: if(tiflags & TH_SYN) goto drop; - case 2: goto drop ; - default : goto drop ; + case 1: + if (tiflags & TH_SYN) + goto drop; + break; + case 2: + goto drop; + default: + goto drop; } - } else - goto dropwithreset; + } + goto dropwithreset; } tp = intotcpcb(inp); if (tp == 0) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 707649156eea..f086ad8b331d 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 - * $Id: udp_usrreq.c,v 1.53 1999/07/11 18:32:46 green Exp $ + * $Id: udp_usrreq.c,v 1.54 1999/08/17 12:17:53 csgr Exp $ */ #include <sys/param.h> @@ -306,7 +306,7 @@ udp_input(m, iphlen) if (badport_bandlim(0) < 0) goto bad; #endif - if(!blackhole) + if (!blackhole) icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0); return; } |