Skip to content

Fix UDP checksum handling in clinat.c#1038

Open
laviniuc wants to merge 1 commit into
OpenVPN:masterfrom
laviniuc:patch-1
Open

Fix UDP checksum handling in clinat.c#1038
laviniuc wants to merge 1 commit into
OpenVPN:masterfrom
laviniuc:patch-1

Conversation

@laviniuc
Copy link
Copy Markdown

#1037

Thank you for your contribution

You are welcome to open PR, but they are used for discussion only. All
patches must eventually go to the openvpn-devel mailing list for review:

Please send your patch using git-send-email. For example to send your latest commit to the list:

$ git send-email --to=openvpn-devel@lists.sourceforge.net HEAD~1

For details, see these Wiki articles:

@laviniuc
Copy link
Copy Markdown
Author

patch for #1037

Comment thread src/openvpn/clinat.c

if (h->u.udp.check == 0)
{
h->u.udp.check = 0xFFFF;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You quoted the RFC saying: "NAT implementations rewriting IP addresses must either leave checksum=0 unchanged or fully recompute the checksum from scratch."

Why setting it to 0xFFFF?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the check after it's been re-adjusted / recomputed. if it happens to be 0 it should be sent as FFFF

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have a reference about this rule that we could add as a comment here?
I was looking up the RFC, but I couldn't find anything about checksum=0.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my bad. For whatever reason I mixed up your patch with another change and got off-track.

@ordex
Copy link
Copy Markdown
Member

ordex commented May 19, 2026

I added a comment to your patch. However, please ensure to write a proper commit message and add a Signed-off-by line, as explained in our Contributing guide, also the patch should be sent to the openvpn-devel for final review and approval (as mentioned in the template that you re-posted above :))

@ordex
Copy link
Copy Markdown
Member

ordex commented May 19, 2026

Since you don't want to send the patch to the mailing list, may I know how you wanna be credited (name + email) so I can prepare and send a patch for you?

Thanks!

@laviniuc
Copy link
Copy Markdown
Author

Since you don't want to send the patch to the mailing list, may I know how you wanna be credited (name + email) so I can prepare and send a patch for you?

Thanks!

thank you,

it is fine by me to leave it annonymous.

@ordex
Copy link
Copy Markdown
Member

ordex commented May 19, 2026

it is fine by me to leave it annonymous.

ok, thank you for the fix!

I'll have to sign the patch in any case, because it's required in order to accept the license and get the code merged.

I'll close this issue once the patch is in.

@ordex
Copy link
Copy Markdown
Member

ordex commented May 19, 2026

patch is on gerrit: https://gerrit.openvpn.net/c/openvpn/+/1681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants