[PATCH] UDP short packet patch for ipv4

From: David Ford (david+cert@blue-labs.org)
Date: Thu Feb 14 2002 - 14:07:39 EST


This patch changes printk to add helpful information...i.e. who to
firewall etc. It is against 2.4.18-rc1. IPV6 needs one too but in my
opinion, a similar NIPQUAD macro needs built and the IPV6 core in
general needs a tidying up to use the new macro.

--- linux/net/ipv4/udp.c.orig Thu Feb 14 13:38:24 2002
+++ linux/net/ipv4/udp.c Thu Feb 14 13:32:34 2002
@@ -928,7 +928,14 @@
        return(0);
 
 short_packet:
- NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "UDP: short
packet: %d/%d\n", ulen, len));
+ NETDEBUG(if (net_ratelimit())
+ printk(KERN_DEBUG "UDP: short packet: %u.%u.%u.%u:%u
%d/%d to %u.%u.%u.%u:%u\n",
+ NIPQUAD(saddr),
+ ntohs(uh->source),
+ ulen,
+ len,
+ NIPQUAD(daddr),
+ ntohs(uh->dest)));
 no_header:
        UDP_INC_STATS_BH(UdpInErrors);
        kfree_skb(skb);



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:01:03 EST