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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 Nov 2015 21:02:13 -0800
From:	Tom Herbert <tom@...bertland.com>
To:	Ben Greear <greearb@...delatech.com>
Cc:	netdev <netdev@...r.kernel.org>
Subject: Re: How to do TCP tx checksums

On Mon, Nov 16, 2015 at 4:20 PM, Ben Greear <greearb@...delatech.com> wrote:
> Hello!
>
> I'm hacking on (my already hacked) pktgen, trying to get it to send TCP
> frames.
>
> And, having issues getting checksums to work properly.
>
> I'm trying this:
>         struct iphdr *iph = ip_hdr(skb);
>         struct net_device *odev = pkt_dev->odev;
>
>         if (pkt_dev->flags & F_TCP) {
>                 if (odev->features & NETIF_F_V4_CSUM) {
>                         skb->ip_summed = CHECKSUM_PARTIAL;
>                 } else {
>                         skb->ip_summed = CHECKSUM_NONE;
>                 }
>                 skb->csum = 0;
>                 __tcp_v4_send_check(skb, iph->saddr, iph->daddr);
>
> I added an export so I could call that __tcp_v4_send_check method
> w/out having to put a fake socket struct on the stack.
>
> But, the receiving NIC reports 100% checksum failure, so obviously
> I'm not doing it correct.
>
> Any suggestions on what I might be doing wrong or the proper method(s)
> to call?
>
It's really hard to tell what is happening without seeing the full
patch your using. Maybe you're not setting the TCP correctly or
transport header is not set right in skb.

Tom

> Thanks,
> Ben
>
>
> --
> Ben Greear <greearb@...delatech.com>
> Candela Technologies Inc  http://www.candelatech.com
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ