[Click] IPFragmenter bug (click-1.4.3)

Alfeiks Kaanoken kaanoken at tercom.ru
Mon Jun 19 10:17:52 EDT 2006


Beyers Cronje wrote:
> Alfeiks,
>
> You need to set the IP Header annotation before the fragmenter. See 
> MarkIPHeader or CheckIPHeader. Also you probably need a Classifier 
> before to only send valid IP packets from FromDevice.
>
> Beyers
So with this all is ok, I'm just change the configuration and all is works.
But I was trying an another configuration and I found a new bug.
I have one machine with click(debug host, MTU=800) and other w/o 
click(test host MTU=1500).
 From the test host I do the following thing:
# hping2 -n -d 1500 -i 10 -2 --dontfrag 1.2.3.2
and get the click assertion in gdb
click: ../lib/ipflowid.cc:32: IPFlowID::IPFlowID(const Packet*): 
Assertion `iph
&& udph && (((iph)->ip_off & (__extension__ ({ register unsigned short 
int __v,
__x = (0x1fff); if (__builtin_constant_p (__x)) __v = ((((__x) >> 8) & 
0xff) | (
((__x) & 0xff) << 8)); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" 
(__x) : "
cc"); __v; }))) == 0)' failed.

Program received signal SIGABRT, Aborted.
0x4013bd81 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x4013bd81 in kill () from /lib/libc.so.6
#1  0x4013bb05 in raise () from /lib/libc.so.6
#2  0x4013d05d in abort () from /lib/libc.so.6
#3  0x4013500f in __assert_fail () from /lib/libc.so.6
#4  0x080f2137 in IPFlowID (this=0xbffff3b0, p=0x0) at ../lib/ipflowid.cc:32
#5  0x080c8383 in IPRewriter::push (this=0x8167090, port=0, p_in=0x0)
    at ../elements/tcpudp/iprewriter.cc:292
#6  0x08093bbb in IPFilter::push (this=0x8167090, p=0x0) at element.hh:314
#7  0x08094497 in IPFragmenter::push (this=0x40227ff4, p=0x6) at 
element.hh:314
#8  0x080f8c3b in Element::push (this=0x8169290, p=0x6) at element.hh:314
#9  0x080f8c3b in Element::push (this=0x8169248, p=0x6) at element.hh:314
#10 0x080b9450 in PaintTee::simple_action (this=0x40227ff4, p=0x816b180)
    at element.hh:314
#11 0x080f8c14 in Element::push (this=0x81693b0, p=0x6)
    at ../lib/element.cc:850
#12 0x080f8c3b in Element::push (this=0x81693b0, p=0x6) at element.hh:314
#13 0x080a0445 in LinearIPLookup::push (this=0x8163f20, p=0x816b180)
    at element.hh:314
#14 0x080f8c3b in Element::push (this=0x8163f20, p=0x6) at element.hh:314
#15 0x080f8c3b in Element::push (this=0x8163ec0, p=0x6) at element.hh:314
#16 0x080f8c3b in Element::push (this=0x8163dd8, p=0x6) at element.hh:314
#17 0x080b10aa in Classifier::push (this=0x81645e0, p=0x816b180)
    at element.hh:314
---Type <return> to continue, or q <return> to quit---
#18 0x080d39d5 in FromDevice::selected (this=0x8164638) at element.hh:314
#19 0x0810f6e3 in Master::run_selects (this=0x8163ae8, more_tasks=244)
    at ../lib/master.cc:597
#20 0x08103a60 in RouterThread::driver (this=0x8163bd8) at 
routerthread.hh:161
#21 0x080e9c93 in main (argc=3, argv=0xbffff804) at master.hh:121

The first of all I looked up for the element.hh:314
_e->push(_port, p);
How I can understand is something wrong in the ``Push'' method.
Do you can help me with this?
I don't know how I can start to the fix of this error.

Thanx
>
> On 6/16/06, *Alfeiks Kaanoken* <kaanoken at tepkom.ru 
> <mailto:kaanoken at tepkom.ru>> wrote:
>
>     Hi folks,
>     Some bug is present in the IPFragmenter.
>     I don't think that it was fixed up in the new release (I was look
>     to the
>     ``diff'' between new and old version).
>     So,
>     I'm was try the following simple configuration
>     aka tmp $> cat click.lo
>     FromDevice(lo) -> IPFragmenter(128) -> Print(ok) -> Discard;
>     and pinging the lo interface when click is running, and get a
>     segfault.
>     aka tmp $> gdb click
>     GNU gdb 6.3
>     Copyright 2004 Free Software Foundation, Inc.
>     GDB is free software, covered by the GNU General Public License,
>     and you are
>     welcome to change it and/or distribute copies of it under certain
>     conditions.
>     Type "show copying" to see the conditions.
>     There is absolutely no warranty for GDB.  Type "show warranty" for
>     details.
>     This GDB was configured as "i486-slackware-linux"...Using host
>     libthread_db libr
>     ary "/lib/libthread_db.so.1".
>
>     "/home/kaanoken/works/tmp/click.lo" is not a core dump: File
>     format not
>     recogniz
>     ed
>     (gdb) run -f click.lo
>     Starting program: /usr/local/bin/click -f click.lo
>
>     Program received signal SIGSEGV, Segmentation fault.
>     0x08093f7a in IPFragmenter::fragment (this=0x815b7e8, p_in=0x815e368)
>         at ../elements/ip/ipfragmenter.cc:102
>     /home/kaanoken/works/click-1.4.3/elements/ip/ipfragmenter.cc:102:2653:beg:0x8093
>     f7a
>     (gdb) bt
>     #0  0x08093f7a in IPFragmenter::fragment (this=0x815b7e8,
>     p_in=0x815e368)
>         at ../elements/ip/ipfragmenter.cc:102
>     #1  0x080d39b5 in FromDevice::selected (this=0x815b6a8) at
>     element.hh:314
>     #2  0x0810f6b3 in Master::run_selects (this=0x815b3b8,
>     more_tasks=false)
>         at ../lib/master.cc:597
>     #3  0x08103a30 in RouterThread::driver (this=0x815b4a8) at
>     routerthread.hh:161
>     #4  0x080e9c73 in main (argc=3, argv=0xbffff7b4) at master.hh:121
>
>     After it I decide to insert some debugging messages and found it -
>     (gdb) run -f click.lo
>     The program being debugged has been started already.
>     Start it from the beginning? (y or n) y
>     `/usr/local/bin/click' has changed; re-reading symbols.
>
>     Starting program: /usr/local/bin/click -f click.lo
>     DEBUG00, ip_in=0x0
>
>     Program received signal SIGSEGV, Segmentation fault.
>     0x08093f8b in IPFragmenter::fragment (this=0x815b828, p_in=0x815e3a8)
>         at ../elements/ip/ipfragmenter.cc:104
>     /home/kaanoken/works/click-
>     1.4.3/elements/ip/ipfragmenter.cc:104:2703:beg:0x8093
>     f8b
>
>     It's located in the elements/ip/ipfragmenter.cc on the line 99:
>     const click_ip *ip_in = p_in->ip_header();
>     click_chatter("DEBUG00, ip_in=0x%X", ip_in);
>     We have the ip_in is NULL.
>
>     it's really a bad thing,
>     what are you can said about this?
>
>     PS I was trying it on the linux box w/o kernel modules.
>
>     Thanx.
>
>
>     --
>     Alfeiks Kaänoken,
>     UNIX Software Developer.
>
>
>     _______________________________________________
>     click mailing list
>     click at amsterdam.lcs.mit.edu <mailto:click at amsterdam.lcs.mit.edu>
>     https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>
>


-- 
Alfeiks Kaänoken,
UNIX Software Developer.




More information about the click mailing list