]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
netlink: fix compatibility with older netlink applications.
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Mon, 16 Jan 2023 12:14:35 +0000 (12:14 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Mon, 23 Jan 2023 22:09:05 +0000 (22:09 +0000)
commit92d8e0f136576d8a57e374fa4e460fc8903b68b6
tree275ab3e4b621881e058f1cb0d6ac5feb9ccb2fde
parent1ce626b94897f8afc6426823de4f03df622313d1
netlink: fix compatibility with older netlink applications.

Some apps try to provide only the non-zero part of the required message
 header instead of the full one. It happens when fetching routes or
 interface addresses, where the first header byte is the family.
This behavior is "illegal" under the "strict" Netlink socket option,
 however there are many applications out there doing things in the
 "old" way.

Support this usecase by copying the provided bytes into the temporary
 zero-filled header and running the parser on this header instead.

Reported by: Goran Mekić <meka@tilda.center>

(cherry picked from commit 228c632ab3f6245df4a08d8692d49c8e12aacc27)
sys/netlink/netlink_message_parser.h
tests/sys/netlink/test_rtnl_ifaddr.py