Date: Fri, 14 Jul 2000 11:29:21 +0300 (EEST) From: hristo@bginfo.net To: FreeBSD-gnats-submit@freebsd.org Subject: kern/19913: add SYN+FIN counter Message-ID: <200007140829.LAA01549@spider.comnet.bg>
next in thread | raw e-mail | index | archive | help
>Number: 19913
>Category: kern
>Synopsis: add SYN+FIN counter
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Fri Jul 14 01:30:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Hristo Grigorov
>Release: FreeBSD 4.0-STABLE i386
>Organization:
BGINFO
>Environment:
FreeBSD 4.0-STABLE i386
>Description:
As you know FreeBSD 4 has an option to drop SYN+FIN packets but it does
not has a counter of how much SYN+FIN packets were actually dropped. This
minor patch add sysctl variable to count them and have it for reference
when needed.
>How-To-Repeat:
Apply the patch.
>Fix:
*** tcp_input.c.old Fri May 12 10:29:45 2000
--- tcp_input.c Thu Jul 13 10:42:06 2000
***************
*** 127,134 ****
--- 127,137 ----
#ifdef TCP_DROP_SYNFIN
static int drop_synfin = 0;
+ static int drop_synfin_pkts = 0;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_RW,
&drop_synfin, 0, "Drop TCP packets with SYN+FIN set");
+ SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin_pkts, CTLFLAG_RD,
+ &drop_synfin_pkts, 0, "Dropped TCP packets with SYN+FIN set");
#endif
#ifdef TCP_RESTRICT_RST
***************
*** 500,507 ****
*
* This is incompatible with RFC1644 extensions (T/TCP).
*/
! if (drop_synfin && (thflags & (TH_SYN|TH_FIN)) == (TH_SYN|TH_FIN))
goto drop;
#endif
/*
--- 503,512 ----
*
* This is incompatible with RFC1644 extensions (T/TCP).
*/
! if (drop_synfin && (thflags & (TH_SYN|TH_FIN)) == (TH_SYN|TH_FIN)) {
! drop_synfin_pkts++;
goto drop;
+ }
#endif
/*
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200007140829.LAA01549>
