mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 21:25:12 +02:00
ipp2p: fix Gnutella line ending detection
There is another mistake in the code. I have checked the Gnutella protocol specification -- looks like the line separation is 0x0d-0x0a and not 0x0a-0x0d (it seemed obvious but I was not sure and thought they cannot have possibly got that wrong...). It would certainly explain why I have never seen a match on any of my systems.
This commit is contained in:

committed by
Jan Engelhardt

parent
aad0cafd19
commit
3f7288abfe
@@ -2,6 +2,7 @@
|
||||
HEAD
|
||||
====
|
||||
- ipp2p: add more boundary checks
|
||||
- ipp2p: fix Gnutelle line ending detection
|
||||
|
||||
|
||||
Xtables-addons 1.19 (October 12 2009)
|
||||
|
@@ -586,8 +586,8 @@ search_all_gnu(const unsigned char *payload, const unsigned int plen)
|
||||
unsigned int c;
|
||||
|
||||
for (c = 0; c < plen - 22; ++c)
|
||||
if (payload[c] == 0x0a &&
|
||||
payload[c+1] == 0x0d &&
|
||||
if (payload[c] == 0x0d &&
|
||||
payload[c+1] == 0x0a &&
|
||||
(memcmp(&payload[c+2], "X-Gnutella-", 11) == 0 ||
|
||||
memcmp(&payload[c+2], "X-Queue:", 8) == 0))
|
||||
return IPP2P_GNU * 100 + 3;
|
||||
|
Reference in New Issue
Block a user