HomeFreeBSD

Relax rtsock message restrictions.

Description

Relax rtsock message restrictions.

Address multiple issues with strict rtsock message validation.

D28668 "normalisation" approach was based on the assumption that
we always have at least "standard" sockaddr len.
It turned out to be false - certain older applications like quagga
or routed abuse sin[6]_len field and set it to the offset to the
first fully-zero bit in the mask. It is impossible to normalise
such sockaddrs without reallocation.

With that in mind, change the approach to use a distinct memory
buffer for the altered sockaddrs. This allows supporting the older
software while maintaining the guarantee on the "standard" sockaddrs.

PR: 255273,255089
Differential Revision: https://reviews.freebsd.org/D29826
MFC after: 3 days

(cherry picked from commit b31fbebeb3d59af359a3417cddfbcf666b2c56c9)

Details

Provenance
melifaroAuthored on Apr 19 2021, 8:49 PM
Differential Revision
D29826: Relax rtsock message restrictions
Parents
rG98a3c20696f8: Improve error reporting in rtsock.c
Branches
Unknown
Tags
Unknown