Fix breakage if blackhole=1 and tiflags & TH_SYN, plus
style(9) fixes Submitted by: Jonathon Lemon
This commit is contained in:
parent
43d79ae9ef
commit
828b7f4069
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50043
@ -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 @@ tcp_input(m, iphlen)
|
||||
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)
|
||||
|
@ -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 @@ tcp_input(m, iphlen)
|
||||
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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user