-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
this segfaults on amd64 in StoreIPAddress::simple_action
RatedSource("some data", 1, 1, STOP true) ->
UDPIPEncap(1.0.0.1, 1234, 2.0.0.2, 1234) ->
StoreIPAddress(3.0.0.3, dst) ->
CheckIPHeader -> // verify that incremental csum still work
IPPrint ->
Discard ;
the attached patch makes the thing work as expected:
$ ./userlevel/click ./conf/storeip.click
1258295906.133130: 1.0.0.1.1234 > 3.0.0.3.1234: udp 17
harald
ps. "_offset = (unsigned) -16" ... interesting magic ;-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAksAFWEACgkQy8wrZ9OvkU2bmwCgnootnZagzBTcZ2+uSWJ1pXLs
7kEAn0VrgtbM6S/9L/CxUQhCZwNZNdjT
=CvEk
-----END PGP SIGNATURE-----
diff --git a/elements/ip/storeipaddress.cc b/elements/ip/storeipaddress.cc
index 9176b5b..5607f62 100644
--- a/elements/ip/storeipaddress.cc
+++ b/elements/ip/storeipaddress.cc
@@ -68,7 +68,7 @@ StoreIPAddress::simple_action(Packet *p)
// special case: store IP address into IP header
// and update checksums incrementally
if (WritablePacket *q = p->uniqueify()) {
- uint16_t *x = reinterpret_cast<uint16_t *>(q->network_header() - _offset);
+ uint16_t *x = reinterpret_cast<uint16_t *>( q->network_header() - (int) _offset );
uint32_t old_hw = (uint32_t) x[0] + x[1];
old_hw += (old_hw >> 16);
_______________________________________________
click mailing list
[email protected]
https://amsterdam.lcs.mit.edu/mailman/listinfo/click