Page MenuHomeFreeBSD

ip6: Drop dead code in ip6_input_hbh()
ClosedPublic

Authored by markj on May 29 2026, 7:33 PM.
Tags
None
Referenced Files
F163166097: D57342.id179416.diff
Mon, Jul 20, 4:45 PM
Unknown Object (File)
Sat, Jul 18, 1:10 PM
Unknown Object (File)
Sat, Jul 18, 7:01 AM
Unknown Object (File)
Thu, Jul 16, 5:16 AM
Unknown Object (File)
Wed, Jul 15, 7:24 AM
Unknown Object (File)
Wed, Jul 15, 7:24 AM
Unknown Object (File)
Sun, Jul 5, 5:20 AM
Unknown Object (File)
Sat, Jun 27, 2:20 PM

Details

Summary

After commit 069a67374ed9, ip6_input() quickly rejects packets with
plen == 0, before ip6_input_hbh() is called. So, there is no need to
check this condition again in the helper function.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.May 29 2026, 7:33 PM
This revision is now accepted and ready to land.May 29 2026, 8:00 PM
This comment was removed by bms.
zlei added inline comments.
sys/netinet6/ip6_input.c
434

Shall those stats be moved to ip6_input(), after the checking if (plen == 0) ?

sys/netinet6/ip6_input.c
434

ifs6_in_discard is handled already. We should increment ifs6_in_hdrerr too I think.

Is ip6s_badoptions still correct? Probably it should be ip6s_tooshort instead?

  • increment more counters
  • add a branch annotation
This revision now requires review to proceed.Jun 1 2026, 5:07 PM
zlei added a subscriber: bz.

Looks good to me.

sys/netinet6/ip6_input.c
434

The ifs6_in_hdrerr was to indicate a packet without JumboPayload option, since

If the payload length field is 0 and the next header field indicates Hop-by-Hop Options header

Since we do not support / check JumboPayload option, then ip6s_tooshort looks reasonable.

CC the original author @bz to see if he has any thoughts about it.

This revision is now accepted and ready to land.Jun 3 2026, 2:51 PM
This revision was automatically updated to reflect the committed changes.