[Wifidog] threads

Philippe April papril777 at yahoo.com
Wed Apr 14 22:58:37 EDT 2004


Decided to test before going to bed, I was too excited.

I have some bad news though. Hope it's something minor, it didn't work...

[debug 4] Received connection from 192.168.1.21
[debug 0] No valid request received from 192.168.1.21
[debug 4] Closing connection with 192.168.1.21
[debug 4] Received connection from 192.168.1.21
[debug 0] No valid request received from 192.168.1.21
[debug 4] Closing connection with 192.168.1.21

And on the browser, a nice 'ERROR : Method Not Implemented'...

I installed tcpdump and it looks like this on port 2060:
00:16:48.521640 192.168.1.21.2471 > 192.168.1.1.2060: S
1381649840:1381649840(0) win 65520 <mss 1260,nop,nop,sackOK> (DF)
0x0000   4500 0030 5884 4000 8006 1edd c0a8 0115        E..0X. at .........
0x0010   c0a8 0101 09a7 080c 525a 4db0 0000 0000        ........RZM.....
0x0020   7002 fff0 4ed2 0000 0204 04ec 0101 0402        p...N...........
00:16:48.531875 192.168.1.21.2471 > 192.168.1.1.2060: . ack 456810280 win
65520 (DF)
0x0000   4500 0028 5886 4000 8006 1ee3 c0a8 0115        E..(X. at .........
0x0010   c0a8 0101 09a7 080c 525a 4db1 1b3a 5f28        ........RZM..:_(
0x0020   5010 fff0 005c 0000                            P....\..
00:16:48.531896 192.168.1.21.2471 > 192.168.1.1.2060: P 0:283(283) ack 1
win 65520 (DF)
0x0000   4500 0143 5887 4000 8006 1dc7 c0a8 0115        E..CX. at .........
0x0010   c0a8 0101 09a7 080c 525a 4db1 1b3a 5f28        ........RZM..:_(
0x0020   5018 fff0 c139 0000 4745 5420 2f20 4854        P....9..GET./.HT
0x0030   5450 2f31 2e31 0d0a 4163 6365 7074 3a20        TP/1.1..Accept:.
0x0040   2a2f 2a0d 0a41 6363 6570 742d 4c61 6e67        */*..Accept-Lang
0x0050   7561 6765 3a20 656e 2d63 610d 0a41 6363        uage:.en-ca..Acc
0x0060   6570 742d 456e 636f 6469 6e67 3a20 677a        ept-Encoding:.gz
0x0070   6970 2c20 6465 666c 6174 650d 0a55 7365        ip,.deflate..Use
0x0080   722d 4167 656e 743a 204d 6f7a 696c 6c61        r-Agent:.Mozilla
0x0090   2f34 2e30 2028 636f 6d70 6174 6962 6c65        /4.0.(compatible
0x00a0   3b20 4d53 4945 2036 2e30 3b20 5769 6e64        ;.MSIE.6.0;.Wind
0x00b0   6f77 7320 4e54 2035 2e31 290d 0a48 6f73        ows.NT.5.1)..Hos
0x00c0   743a 2077 7777 2e67 6f6f 676c 652e 6361        t:.www.google.ca
0x00d0   0d0a 436f 6e6e 6563 7469 6f6e 3a20 4b65        ..Connection:.Ke
0x00e0   6570 2d41 6c69 7665 0d0a 436f 6f6b 6965        ep-Alive..Cookie
0x00f0   3a20 5052 4546 3d49 443d 3137 6566 3737        :.PREF=ID=17ef77
0x0100   6232 3735 3739 3462 3464 3a4c 443d 656e        b275794b4d:LD=en
0x0110   3a54 4d3d 3130 3831 3938 3839 3035 3a4c        :TM=1081988905:L
0x0120   4d3d 3130 3831 3939 3637 3237 3a53 3d78        M=1081996727:S=x
0x0130   5945 4d62 4831 7643 4b61 7a75 5f48 790d        YEMbH1vCKazu_Hy.
0x0140   0a0d 0a                                        ...
00:16:48.537485 192.168.1.21.2471 > 192.168.1.1.2060: . ack 42 win 65480 (DF)
0x0000   4500 0028 588a 4000 8006 1edf c0a8 0115        E..(X. at .........
0x0010   c0a8 0101 09a7 080c 525a 4ecc 1b3a 5f51        ........RZN..:_Q
0x0020   5010 ffc8 ff3f 0000                            P....?..
00:16:48.541904 192.168.1.21.2471 > 192.168.1.1.2060: F 283:283(0) ack 42
win 65480 (DF)
0x0000   4500 0028 588b 4000 8006 1ede c0a8 0115        E..(X. at .........
0x0010   c0a8 0101 09a7 080c 525a 4ecc 1b3a 5f51        ........RZN..:_Q
0x0020   5011 ffc8 ff3e 0000                            P....>..

Weird huh? Then the response comes back on port 80:
00:16:28.610799 64.233.167.99.80 > 192.168.1.21.2469: S
424965625:424965625(0) ack 1376567697 win 5840 <mss 1460,nop,nop,sackOK>
(DF)
0x0000   4500 0030 0000 4000 4006 90be 40e9 a763        E..0.. at .@... at ..c
0x0010   c0a8 0115 0050 09a5 1954 75f9 520c c191        .....P...Tu.R...
0x0020   7012 16d0 1555 0000 0204 05b4 0101 0402        p....U..........
00:16:28.616224 64.233.167.99.80 > 192.168.1.21.2469: . ack 284 win 5840 (DF)
0x0000   4500 0028 f7d7 4000 4006 98ee 40e9 a763        E..(.. at .@... at ..c
0x0010   c0a8 0115 0050 09a5 1954 75fa 520c c2ac        .....P...Tu.R...
0x0020   5010 16d0 40fe 0000                            P... at ...
00:16:28.621231 64.233.167.99.80 > 192.168.1.21.2469: P 1:41(40) ack 284
win 5840 (DF)
0x0000   4500 0050 f7d8 4000 4006 98c5 40e9 a763        E..P.. at .@... at ..c
0x0010   c0a8 0115 0050 09a5 1954 75fa 520c c2ac        .....P...Tu.R...
0x0020   5018 16d0 4ba8 0000 0a3c 423e 4552 524f        P...K....<B>ERRO
0x0030   5220 3a20 4d65 7468 6f64 204e 6f74 2049        R.:.Method.Not.I
0x0040   6d70 6c65 6d65 6e74 6564 3c2f 423e 0a0a        mplemented</B>..
00:16:28.622550 64.233.167.99.80 > 192.168.1.21.2469: F 41:41(0) ack 284
win 5840 (DF)
0x0000   4500 0028 f7d9 4000 4006 98ec 40e9 a763        E..(.. at .@... at ..c
0x0010   c0a8 0115 0050 09a5 1954 7622 520c c2ac        .....P...Tv"R...
0x0020   5011 16d0 40d5 0000                            P... at ...
00:16:28.627914 64.233.167.99.80 > 192.168.1.21.2469: . ack 285 win 5840 (DF)
0x0000   4500 0028 0000 4000 ff06 d1c5 40e9 a763        E..(.. at .....@..c
0x0010   c0a8 0115 0050 09a5 1954 7623 520c c2ad        .....P...Tv#R...
0x0020   5010 16d0 40d4 0000                            P... at ...


And also btw, OpenWRT now has some sweet admcfg tool to configure (looks
like) each ports separately or something, I'll look into it a bit, I have
no idea if it's flexible or not.

An example:

/bin # ./admcfg
OpenWRT ADM Config:

port0   ENABLED 100Mbps FD FLOW UNTAG VLAN NOPRIO
        UP 100Mbps FD NOFLOW
        PRIO:0 PVID:1 vlan1
        RX packets:3061
        TX packets:2677
        collisions:0 errors:0
        RX bytes:944671 (922.5 KiB) TX bytes:292342 (285.4 KiB)

port1   ENABLED 100Mbps FD FLOW UNTAG VLAN NOPRIO
        DOWN 10Mbps HD FLOW
        PRIO:0 PVID:2 vlan2
        RX packets:0
        TX packets:0
        collisions:0 errors:0
        RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Looks nice.

I'll debug tomorrow.

Philippe

> All,
>
> The good news is that even after Alex's amazing work on implementing the
> threads (which works really well so far), I can still compile and make it
> run on the WRT54G.
>
> All that's tricky, is the actual linking... Since libpthread.so doesn't
> get put on the filesystem of openwrt, we would have to tweak the compiling
> of openwrt a little bit to include it, or we just link statically (which
> is what I did).
>
> Oh and it took me a while to understand that I had to use the same linker
> that I used to link the other image, otherwise it wouldn't work (I was
> using the one provided by linksys... openwrt recompiles it I think).
>
> The only thing weird is that doing CTRL-C would call fw_destroy twice,
> probably a minor bug.
>
> I only tried running it btw, I could not try the actual captive portal
> thing because it's getting late now and my WRT54G is not using the
> "Internet" port at the moment (acting as a switch only basically).
>
> I'll give it a try tomorrow night and keep you updated... Again, great
> work Alex.
>
> Philippe
>
>> On Wed, Apr 14, 2004 at 06:36:03PM -0400, Philippe April wrote:
>>>
>>> neato. I'll start looking at it.
>>
>> 	I got myself a test environement on the mac. It works fully. ;-)
>>
>> 	Segfault is gone. Threads work.
>>
>> 	Enjoy.
>>
>> Alex
>>
>> _______________________________________________
>> Wifidog mailing list
>> Wifidog at isf.waglo.com
>> http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com
>>
>
>
> _______________________________________________
> Wifidog mailing list
> Wifidog at isf.waglo.com
> http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com
>
>


_______________________________________________
Wifidog mailing list
Wifidog at isf.waglo.com
http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com



More information about the Wifidog mailing list