Page MenuHomeFreeBSD

Convert ip6_forward() to the new routing KPI.
ClosedPublic

Authored by melifaro on Apr 7 2020, 10:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 2 2024, 12:16 PM
Unknown Object (File)
Sep 22 2024, 3:18 AM
Unknown Object (File)
Sep 6 2024, 1:08 PM
Unknown Object (File)
Sep 2 2024, 8:17 PM
Unknown Object (File)
Aug 31 2024, 7:54 PM
Unknown Object (File)
Aug 19 2024, 2:40 AM
Unknown Object (File)
Aug 18 2024, 11:14 PM
Unknown Object (File)
Aug 18 2024, 10:06 PM
Subscribers

Details

Summary

Convert ip6_forward() to the new routing KPI.

This change depends on D24232.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

melifaro added reviewers: ae, bz, network.

Update review to account for committed changes.

sys/netinet6/ip6_forward.c
206 ↗(On Diff #70478)

stale comment

242 ↗(On Diff #70478)

This looks strange, why we don't send ICMP6_DST_UNREACH_BEYONDSCOPE here? Also ifs6_in_discard is not accounted.

sys/netinet6/ip6_forward.c
242 ↗(On Diff #70478)

I would prefer to address it in a separate review, as IMO these 2 blocks should be rewritten and simplified.

At this moment we know that src & dst are unicast, hence each can be either link-local or global unicast.
This brings matrix of 4 options: ll-ll, ll-gu, gu-ll and gu-gu.
If gu-gu, no scope checks are needed. For the rest 3, as one or both addresses are link-local, both received and transmitted interface has to be the same.

This can lead to the logic similar to:

if (LL(src) or LL(dst)) {
  if (src_ifp != dst_ifp)
   error
}

instead of the 2 checks above.

Does this sound sane to you?

Update to reflect ae@ comments.

ae added inline comments.
sys/netinet6/ip6_forward.c
242 ↗(On Diff #70478)

Yes, this sounds correct for me.

This revision is now accepted and ready to land.Apr 14 2020, 9:55 AM
This revision was automatically updated to reflect the committed changes.