using ipfw seems to interfere with socket communication



After I added the following rules to my ipfw configuration:

ipfw pipe 1 config bw 2000000000Mbit/s
ipfw add 200 pipe 1 tcp from any to any

The following test from Tcl's regression-test suite started to fail:

set s [socket -server accept 0]
set sock ""
set s2 [socket 127.0.0.1 [lindex [fconfigure $s -sockname] 2]]
vwait sock
puts $s2 "one"
flush $s2
after 500
fconfigure $sock -blocking 0
set result a:[gets $sock]
lappend result b:[gets $sock]
fconfigure $sock -blocking 1
puts $s2 "two"
flush $s2
fconfigure $sock -blocking 0
lappend result c:[gets $sock]
fconfigure $sock -blocking 1
close $s2
close $s
close $sock
set result

Instead of the expected ``a:one b: c:two'', the result was consistently
``a:one b: c:''. This means, the gets in the line:

lappend result c:[gets $sock]

was always returning empty string, instead of the string "two", that was
written into the socket and flushed.

Is the test wrong, and such result is possible, or is dummynet triggering a
bug? Unloading the dummynet module allows the test to succeed...

Thanks!

-mi
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Tcl UDP Server vs Python UDP server, not good....
    ... Also changing the server reply to a puts to stdio, seems to suggest that the call-back sendTime is being invoked twice for each message received from client. ... proc sendTime {sock} { ... set peer [fconfigure $sock -peer] ...
    (comp.lang.tcl)
  • Re: Who maintains Tclhttpd?
    ... puts $sock $message ... Log $sock LostSocket $data$err ... It sounds like the fconfigure probably is right. ...
    (comp.lang.tcl)
  • Re: Socket Infinitely Readable, Not EOF
    ... set::eof 0 proc myacceptsock {fconfigure $sock -encoding binary -translation binary # change for testing ...
    (comp.lang.tcl)
  • Re: channels and null end of messages
    ... proc blow {sock line} ... I keep a string buffer for the channel (omitting timeout ... set fblock [fconfigure $sock -blocking] ...
    (comp.lang.tcl)