Page MenuHomeFreeBSD

Don't send ICMPv6 packets when the checksum is wrong
ClosedPublic

Authored by tuexen on Apr 19 2019, 4:46 PM.

Details

Summary

This patch fixes the following issue related to the IPPROTO_IPV6 level socket option IPV6_CHECKSUM:

When receiving a packet with an incorrect checksum, just discard it and don't send an ICMP message indicating a parameter problem.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tuexen created this revision.Apr 19 2019, 4:46 PM
bz accepted this revision.Apr 19 2019, 5:20 PM

Again, can you you please mention rip6_input() in the commit message?

No matter how often I read the message I still wonder "why discard rather than sending an ICMPv6 message?" Maybe elaborating on it a bit more might help.

This revision is now accepted and ready to land.Apr 19 2019, 5:20 PM
bz added inline comments.Apr 19 2019, 5:22 PM
sys/netinet6/raw_ip6.c
170 ↗(On Diff #56388)

Somehow I hate the buttons down taking my comments away...

I had written:
(a) please try not to initialise further variables at declaration time. (style)
(b) given we allow the use of bool in the kernel, this would suffice.
(c) or you could just add a comment down there and set proto = IPPROTO_NONE and be done without an extra variable.

In either way, I consider it a style fix. The functional change seems correct.

tuexen updated this revision to Diff 56394.Apr 19 2019, 5:39 PM

Integrate change suggested by bz@.

This revision now requires review to proceed.Apr 19 2019, 5:39 PM
tuexen marked an inline comment as done.Apr 19 2019, 5:40 PM
tuexen added inline comments.
sys/netinet6/raw_ip6.c
170 ↗(On Diff #56388)

I agree and used (c).

bz accepted this revision.Apr 19 2019, 5:52 PM
This revision is now accepted and ready to land.Apr 19 2019, 5:52 PM
This revision was automatically updated to reflect the committed changes.
tuexen marked an inline comment as done.