lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1407159435-7951-4-git-send-email-zoltan.kiss@citrix.com>
Date:	Mon, 4 Aug 2014 14:37:13 +0100
From:	Zoltan Kiss <zoltan.kiss@...rix.com>
To:	Steffen Klassert <steffen.klassert@...unet.com>,
	Mathias Krause <minipli@...glemail.com>,
	Daniel Borkmann <dborkman@...hat.com>
CC:	Zoltan Kiss <zoltan.kiss@...rix.com>,
	"David S. Miller" <davem@...emloft.net>,
	Thomas Graf <tgraf@...g.ch>, Joe Perches <joe@...ches.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<xen-devel@...ts.xenproject.org>
Subject: [PATCH net-next 3/4 RFC] pktgen: Fixing UPD checksum calculation

It passes port number instead of IP address for checksuming. The udp4_hwcsum()
call is also bad, but my next patch will get rid of it anyway. The IPv6 code
does it correctly already. It also changes replaces 8 with sizeof(struct udphdr) 

Signed-off-by: Zoltan Kiss <zoltan.kiss@...rix.com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Thomas Graf <tgraf@...g.ch>
Cc: Joe Perches <joe@...ches.com>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: xen-devel@...ts.xenproject.org
---
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index ba61e2b..d8905cd 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3061,8 +3061,9 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
 		__wsum csum = udp_csum(skb);
 
 		/* add protocol-dependent pseudo-header */
-		udph->check = csum_tcpudp_magic(udph->source, udph->dest,
-						datalen + 8, IPPROTO_UDP, csum);
+		udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr,
+						datalen + sizeof(struct udphdr),
+						IPPROTO_UDP, csum);
 
 		if (udph->check == 0)
 			udph->check = CSUM_MANGLED_0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ