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:
Chris Blum
2009-10-15 16:27:06 +02:00
committed by Jan Engelhardt
parent aad0cafd19
commit 3f7288abfe
2 changed files with 3 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
HEAD
====
- ipp2p: add more boundary checks
- ipp2p: fix Gnutelle line ending detection
Xtables-addons 1.19 (October 12 2009)

View File

@@ -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;