Page MenuHomeFreeBSD

[rtsock] Enforce netmask/RTF_HOST consistency
ClosedPublic

Authored by melifaro on Apr 23 2021, 9:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 20, 10:31 AM
Unknown Object (File)
Sep 8 2025, 6:15 AM
Unknown Object (File)
Sep 3 2025, 7:59 PM
Unknown Object (File)
Sep 1 2025, 11:51 PM
Unknown Object (File)
Aug 31 2025, 9:19 PM
Unknown Object (File)
Aug 25 2025, 9:34 PM
Unknown Object (File)
Aug 19 2025, 2:03 PM
Unknown Object (File)
Jul 4 2025, 6:44 AM
Subscribers

Details

Summary

Traditionally we had 2 sources of information whether the added/delete route request targets network or a host route:
netmask (RTA_NETMASK) and RTF_HOST flag.

The former one is tricky: netmask can be empty or can explicitly specify the host netmask. Parsing netmask sockaddr requires per-family parsing and that's what rtsock code traditionally avoided. As a result, consistency was not enforced and it was possible to specify network with the RTF_HOST flag and vice versa.

Continue normalization efforts from D29826 and D29826 and ensure that RTF_HOST flag always reflects host/network data from netmask field.

Diff Detail

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