LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-09-2019, 12:25 PM   #1
calmy2008
LQ Newbie
 
Registered: Jan 2019
Posts: 1

Rep: Reputation: Disabled
Proper udp csum using linux kernel functions


I have un issue with calculating the checksum for IPv6 packet in the linux kernel module.

I tried the next way:

Code:
struct in6_addr LINK_LOCAL_MULTICAST = {{{ 0xff,02,0,0,0,0,0,0,0,0,0,0,0,1,0,2 }}};
struct in6_addr LINK_LOCAL_SRC = {{{ 0xfe,0x80,0,0,0,0,0,0,0x0a,0x00,0x27,0xff,0xfe,0x5b,0x58,0xcf }}};
udph->len = htons(sizeof(struct udphdr)+sizeof(struct udp_payload));
__wsum csum  = csum_partial((char*) udph, udhp->len, 0);
 udph->check = csum_ipv6_magic(&LINK_LOCAL_SRC, &LINK_LOCAL_MULTICAST, udph->len, IPPROTO_UDP,csum);

Please find the packet in wireshark. I changed the offload settings(tx,rx) but the checksum still incorrect. Could you please suggest what I have to change to get correct checksum.
Wireshark image capture

Last edited by calmy2008; 01-11-2019 at 02:24 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
uknown url type udp when using a udp tracker fakie_flip Linux - Software 1 08-03-2006 05:03 AM
RFC 868 udp 37 time-udp gpl SUSE / openSUSE 2 03-31-2005 10:07 AM
Proper style for functions exvor Programming 4 02-13-2005 12:07 PM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM
what is the proper way to make changes to udp.c? coontie Linux - Networking 3 03-04-2004 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration