HomeFreeBSD

Split gigantic rtsock route_output() into smaller functions.

Description

Split gigantic rtsock route_output() into smaller functions.

Amount of changes to the original code has been intentionally minimised
to ease diffing.
The changes are mostly mechanical, with the following exceptions:

  • lltable handler is now called directly based of RTF_LLINFO flag presense.
  • "report" logic for updating rtm in RTM_GET/RTM_DELETE has been simplified, fixing several potential use-after-free cases in rt_addrinfo.
  • llable asserts has been replaced with error-returning, preventing kernel crashes when lltable gw af family is invalid (root required).

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22864

Details