]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
ipp2p: remove log flooding
authorJan Engelhardt <jengelh@medozas.de>
Sat, 10 Jan 2009 03:46:26 +0000 (04:46 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Sat, 10 Jan 2009 03:47:14 +0000 (04:47 +0100)
Syslog was flooded by lots of messages due to if (plen >= 5) firing
on any packet, when it should have been plen < 5. Incidentally, this
turned up that plen also takes on huge nonsense values, assuming
underflow - yet to be investigated.

extensions/xt_ipp2p.c

index 9c407ea7bb16b2429fce4d243b19bbaf848c643d..16203f9518048eab67b96af795520655b3d416dd 100644 (file)
@@ -603,8 +603,13 @@ search_all_kazaa(const unsigned char *payload, const unsigned int plen)
 {
        uint16_t c, end, rem;
 
-       if (plen >= 5) {
-               printk(KERN_WARNING KBUILD_MODNAME ": %s: plen (%u) < 5\n",
+       if (plen < 5)
+               /* too short for anything we test for - early bailout */
+               return 0;
+
+       if (plen >= 65535) {
+               /* Something seems _really_ fishy */
+               printk(KERN_WARNING KBUILD_MODNAME ": %s: plen (%u) >= 65535\n",
                       __func__, plen);
                return 0;
        }