Skip to contentSkip to conversation

fix unclean udp checksum check

PATCH In review Guillaume Morin 2 participants 2 messages Sep 10, 2002 – Sep 12, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix unclean udp checksum check

Hi folk,

unclean does not handle udp packets with a null checksum, altough udp checksums are not mandatory.

Here is the (trivial) patch which fixes that :

net/ipv4/netfilter/ipt_unclean.c +1 -1
diff -uNr linux-2.4.19-vanilla/net/ipv4/netfilter/ipt_unclean.c linux/net/ipv4/netfilter/ipt_unclean.c
@@ -211,7 +211,7 @@
 
 	/* Bad checksum?  Don't print, just say it's unclean. */
 	/* FIXME: SRC ROUTE packets won't match checksum --RR */
-	if (!more_frags && !embedded
+	if (!more_frags && !embedded && udph->check
 	    && csum_tcpudp_magic(iph->saddr, iph->daddr, datalen, IPPROTO_UDP,
 				 csum_partial((char *)udph, datalen, 0)) != 0)
 		return 0;

Please apply.

Regards,

Signature · 4 lines
Guillaume Morin <[email protected]>

              Linux is user friendly. Linux is not idiot friendly
             If you don't understand that, use Windows (Anonymous)
#1 lore raw
Quoted 4 lines · Guillaume Morin

Hi folk,

unclean does not handle udp packets with a null checksum, altough udp checksums are not mandatory.

thanks, fix is now in patch-o-matic (I'm going to submit it to davem soon)

Quoted 1 line

Guillaume Morin <[email protected]>

Signature · 5 lines
Live long and prosper
- Harald Welte / [email protected]               http://www.gnumonks.org/
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M+ 
V-- PS++ PE-- Y++ PGP++ t+ 5-- !X !R tv-- b+++ !DI !D G+ e* h--- r++ y+(*)