Page MenuHomeFreeBSD

ip6: Drop dead code in ip6_input_hbh()
ClosedPublic

Authored by markj on Fri, May 29, 7:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 18, 11:17 AM
Unknown Object (File)
Wed, Jun 17, 5:39 PM
Unknown Object (File)
Wed, Jun 17, 10:04 AM
Unknown Object (File)
Wed, Jun 10, 2:58 AM
Unknown Object (File)
Sun, Jun 7, 11:58 AM
Unknown Object (File)
Sun, Jun 7, 7:27 AM
Unknown Object (File)
Sun, Jun 7, 7:23 AM
Unknown Object (File)
Sun, Jun 7, 2:16 AM

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 Skipped
Unit
Tests Skipped
Build Status
Buildable 73608
Build 70491: arc lint + arc unit

Event Timeline

markj requested review of this revision.Fri, May 29, 7:33 PM
This revision is now accepted and ready to land.Fri, May 29, 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.Mon, Jun 1, 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.Wed, Jun 3, 2:51 PM
This revision was automatically updated to reflect the committed changes.