Re: IPFW2 skipto + logging

2003-01-20 Thread Maxim Konovalov
On 00:35+0100, Jan 15, 2003, Wiktor Niesiobedzki wrote:

 On Tue, Jan 14, 2003 at 01:18:02PM +0300, Maxim Konovalov wrote:
  On 17:20+0100, Jan 13, 2003, Wiktor Niesiobedzki wrote:
   It seems, that now logging with skipto is working correctly (I get expected
   results), but funny thing, when there is no log rule, the skipto command won't
   work.
 
  Yes, my bad. Corrected patch:
 
 Now it's working correctly. Thanks.

Fixed in rev. 1.24 sys/netinet/ip_fw2.c, thanks for the report.

-- 
Maxim Konovalov, [EMAIL PROTECTED], [EMAIL PROTECTED], +7 (095) 796979

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: IPFW2 skipto + logging

2003-01-14 Thread Maxim Konovalov
On 17:20+0100, Jan 13, 2003, Wiktor Niesiobedzki wrote:

 On Sun, Jan 12, 2003 at 04:52:53PM +0300, Maxim Konovalov wrote:
 
  Hello,
 
  Please try a next patch:
 
 It seems, that now logging with skipto is working correctly (I get expected
 results), but funny thing, when there is no log rule, the skipto command won't
 work.

Yes, my bad. Corrected patch:

Index: sys/netinet/ip_fw2.c
===
RCS file: /home/ncvs/src/sys/netinet/ip_fw2.c,v
retrieving revision 1.22
diff -u -r1.22 ip_fw2.c
--- sys/netinet/ip_fw2.c27 Dec 2002 17:43:25 -  1.22
+++ sys/netinet/ip_fw2.c14 Jan 2003 10:16:30 -
@@ -1180,6 +1180,8 @@

/* look for action, in case it is a skipto */
cmd = ACTION_PTR(me);
+   if (cmd-opcode == O_LOG)
+   cmd += F_LEN(cmd);
if ( cmd-opcode == O_SKIPTO )
for (rule = me-next; rule ; rule = rule-next)
if (rule-rulenum = cmd-arg1)

%%%

-- 
Maxim Konovalov, MAcomnet, Internet Dept., system engineer
phone: +7 (095) 796-9079, mailto:[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: IPFW2 skipto + logging

2003-01-14 Thread Wiktor Niesiobedzki
On Tue, Jan 14, 2003 at 01:18:02PM +0300, Maxim Konovalov wrote:
 On 17:20+0100, Jan 13, 2003, Wiktor Niesiobedzki wrote:
  It seems, that now logging with skipto is working correctly (I get expected
  results), but funny thing, when there is no log rule, the skipto command won't
  work.
 
 Yes, my bad. Corrected patch:
 
Now it's working correctly. Thanks.

Wiktor Niesiobedzki

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: IPFW2 skipto + logging

2003-01-13 Thread Wiktor Niesiobedzki
On Sun, Jan 12, 2003 at 04:52:53PM +0300, Maxim Konovalov wrote:
 
 Hello,
 
 Please try a next patch:
 
It seems, that now logging with skipto is working correctly (I get expected
results), but funny thing, when there is no log rule, the skipto command won't
work.
Consider this results:
portal# ipfw show
00100172 139364 skipto 400 log ip from 192.168.0.0/24 to
192.168.0.0/24
00101  0  0 skipto 400 log ip from 192.168.0.0/24 to
192.168.0.0/24
00102  0  0 skipto 400 log ip from 192.168.0.0/24 to
192.168.0.0/24
00400180 140052 allow ip from any to any
65535  0  0 deny ip from any to any

and

portal# ipfw show
00100186 140632 skipto 400 ip from 192.168.0.0/24 to
192.168.0.0/24
00101186 140632 skipto 400 ip from 192.168.0.0/24 to
192.168.0.0/24
00102186 140632 skipto 400 ip from 192.168.0.0/24 to
192.168.0.0/24
00103186 140632 skipto 400 ip from 192.168.0.0/24 to
192.168.0.0/24
00400192 141136 allow ip from any to any
65535  0  0 deny ip from any to any

The second one, without logging is just not working now...

Best regards,

Wiktor Niesiobedzki

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: IPFW2 skipto + logging

2003-01-12 Thread Maxim Konovalov

Hello,

On 17:34+0100, Nov 10, 2002, Wiktor Niesiobedzki wrote:

 Hi,

 Rule of the format:
 ipfw add 100 skipto 400 log logamount 0 ip from 192.168.0.0/24 to 192.168.0.0/24
 Will give this strange result:
 Nov 10 17:01:05 portal kernel: ipfw: 100 SkipTo 400 TCP 192.168.0.1:139 
192.168.0.2:1170 out via ed0
 Nov 10 17:01:05 portal kernel: ipfw: 310 Pipe 2 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
 Nov 10 17:01:05 portal kernel: ipfw: 320 Pipe 2 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
 Nov 10 17:01:05 portal kernel: ipfw: 340 Pipe 3 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
 Nov 10 17:01:05 portal kernel: ipfw: 340 Pipe 4 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
 Nov 10 17:01:05 portal kernel: ipfw: 360 Pipe 4 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
 Nov 10 17:01:05 portal kernel: ipfw: 380 Pipe 4 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
 Nov 10 17:01:05 portal kernel: ipfw: 800 Accept TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0

 So, clearly saying - will not work, the rule:
 ipfw add 100 skipto 400 ip from 192.168.0.0/24 to 192.168.0.0/24
 is working correctly.

 Is there any problems with ACTION_PTR macro?

Please try a next patch:

Index: sys/netinet/ip_fw2.c
===
RCS file: /home/ncvs/src/sys/netinet/ip_fw2.c,v
retrieving revision 1.22
diff -u -r1.22 ip_fw2.c
--- sys/netinet/ip_fw2.c27 Dec 2002 17:43:25 -  1.22
+++ sys/netinet/ip_fw2.c12 Jan 2003 13:49:48 -
@@ -1180,6 +1180,7 @@

/* look for action, in case it is a skipto */
cmd = ACTION_PTR(me);
+   cmd += F_LEN(cmd);
if ( cmd-opcode == O_SKIPTO )
for (rule = me-next; rule ; rule = rule-next)
if (rule-rulenum = cmd-arg1)

%%%

-- 
Maxim Konovalov, MAcomnet, Internet Dept., system engineer
phone: +7 (095) 796-9079, mailto:[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



IPFW2 skipto + logging

2002-11-10 Thread Wiktor Niesiobedzki
Hi,

Rule of the format:
ipfw add 100 skipto 400 log logamount 0 ip from 192.168.0.0/24 to 192.168.0.0/24
Will give this strange result:
Nov 10 17:01:05 portal kernel: ipfw: 100 SkipTo 400 TCP 192.168.0.1:139 
192.168.0.2:1170 out via ed0
Nov 10 17:01:05 portal kernel: ipfw: 310 Pipe 2 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
Nov 10 17:01:05 portal kernel: ipfw: 320 Pipe 2 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
Nov 10 17:01:05 portal kernel: ipfw: 340 Pipe 3 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
Nov 10 17:01:05 portal kernel: ipfw: 340 Pipe 4 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
Nov 10 17:01:05 portal kernel: ipfw: 360 Pipe 4 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
Nov 10 17:01:05 portal kernel: ipfw: 380 Pipe 4 TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0
Nov 10 17:01:05 portal kernel: ipfw: 800 Accept TCP 192.168.0.1:139 192.168.0.2:1170 
out via ed0

So, clearly saying - will not work, the rule:
ipfw add 100 skipto 400 ip from 192.168.0.0/24 to 192.168.0.0/24
is working correctly.

Is there any problems with ACTION_PTR macro?


Wiktor Niesiobedzki

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message