From owner-FreeBSD-users-jp@jp.freebsd.org  Sun Sep 17 22:38:02 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id WAA82294;
	Sun, 17 Sep 2000 22:38:02 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from hiroshima-u.ac.jp (hpn2.ipc.hiroshima-u.ac.jp [133.41.17.22])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id WAA82289
	for <FreeBSD-users-jp@jp.freebsd.org>; Sun, 17 Sep 2000 22:38:01 +0900 (JST)
	(envelope-from forte@earthcorp.com)
Received: from 192.168.0.2 (ppp-saijo-145.ipc.hiroshima-u.ac.jp [133.41.4.145])
	by hiroshima-u.ac.jp (8.9.3+3.2W/3.7W) with ESMTP id WAA03969
	for <FreeBSD-users-jp@jp.freebsd.org>; Sun, 17 Sep 2000 22:37:58 +0900 (JST)
Message-ID: <20000917134159.17541@133.41.17.12>
From: Okamoto RYO <forte@earthcorp.com>
To: FreeBSD-users-jp@jp.freebsd.org
Date: Sun, 17 Sep 2000 22:41:28 +0900
In-Reply-To: <000701c01ec7$dfd6dee0$e994fea9@pcagent>
References: <000701c01ec7$dfd6dee0$e994fea9@pcagent>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-2022-JP"
Content-Transfer-Encoding: 7bit
X-Mailer: ARENA Internet Mailer 1.6.5 PPC
X-Priority: 3
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: FreeBSD-users-jp 55299
Subject: [FreeBSD-users-jp 55299] Re: IP =?ISO-2022-JP?B?GyRCJVAbKEI=?=
 =?ISO-2022-JP?B?GyRCJTElQyVIISEkSyREJCQkRhsoSg==?= 
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org
X-Originator: forte@earthcorp.com

$B$*$+$b$H$G$9!#(J

 $B!V(J[FreeBSD-users-jp 55223] IP $B%P%1%C%H!!$K$D$$$F(J $B!W(J Ryo $B$5$s(J
/$B!1!1!1!1!1!1!1(J
>$B$?$+$.$G$9!#(J
>
>$B8=:_!!(JSYN$B%U%i%0!!$@$1%m%0$KEG$$$F$^$9$,!"A4It$N%P%1%C%H$r(J
>$B<h$k$K$O!!$I$NMM$K$7$?$i$h$$$N$G$7$g$&!)(J


$B$b$7$+$7$F!"$=$l$O(J SYN $B%U%i%00J30$rH<$&(J TCP packet $B$b(J log_in_vain $B$G(J
logging$B$7$?$$!"$H$$$&0UL#$G$7$g$&$+!#(J

$B$3$3$K>pJs$,$"$j$^$9$,!&!&(J
http://home.hiroshima-u.ac.jp/u0682151/how2.html#log_in_vain

$B8=:_!"%Q%C%A$N%j%s%/$,@Z$l$F$$$k$N$G!"2<$KD%$jIU$1$F$_$^$7$?!#(J
$B$?$@$7$3$l$O(J 2.2.x $BMQ$@$H;W$&$N$G!";d$O$$$D$b<j%Q%C%A$7$F$$$^$9!#(J

$B;d$,;n$7$?$H$3$m!"$9$Y$F$N%U%i%0$,N)$C$?!)%Q%1%C%H$J$I$O$&$^$/(J
$B$R$C$+$+$i$J$$$h$&$G$9!#>\$7$/$O$o$+$j$^$;$s$,!#(J

$B0J2<!"(Jtcp_input.diff.txt $B$G$9!#(J


twentythree# diff -p tcp_input.c.orig tcp_input.c

*** tcp_input.c.orig    Sat Sep 19 23:13:02 1998
--- tcp_input.c Sat Sep 19 23:16:17 1998
*************** findpcb:
*** 388,401 ****
         * but should either do a listen or a connect soon.
         */
        if (inp == NULL) {
!               if (log_in_vain && tiflags & TH_SYN) {
                        char buf[4*sizeof "123"];
  
                        strcpy(buf, inet_ntoa(ti->ti_dst));
                        log(LOG_INFO,
!                           "Connection attempt to TCP %s:%d from %s:%d\n",
                            buf, ntohs(ti->ti_dport), inet_ntoa(ti->ti_src),
                            ntohs(ti->ti_sport));
                }
                goto dropwithreset;
        }
--- 388,417 ----
         * but should either do a listen or a connect soon.
         */
        if (inp == NULL) {
!               if (log_in_vain && tiflags & (TH_FLAGS)) {
                        char buf[4*sizeof "123"];
  
                        strcpy(buf, inet_ntoa(ti->ti_dst));
                        log(LOG_INFO,
!                           "Connection attempt to TCP %s:%d from %s:%d ",
                            buf, ntohs(ti->ti_dport), inet_ntoa(ti->ti_src),
                            ntohs(ti->ti_sport));
+ 
+       /* 
+        * Code below added by Jan Koum <jkb@freebsd.org> to log flags
+        * of tcp packets via net.inet.tcp.log_in_vain - "man sysctl"
+        */
+ 
+               printf("flags=0x%b\n", ti->ti_flags,
+               "\020"
+               "\001FIN"
+               "\002SYN"
+               "\003RST"
+               "\004PUSH"
+               "\005ACK"
+               "\006URG"
+               );
+ 
                }
                goto dropwithreset;
        }


_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  @@ Studio Rock'a'forte 2000 @@
   E-mail : forte@earthcorp.com
   written by : Okamoto RYO (^^)
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
