HomeFreeBSD

netlink: fix adding an interface route

Description

netlink: fix adding an interface route

route add <host> -iface <netif>" for a netif without an IPv4/IPv6
address fails with EINVAL. Need to use a link-level ifaddr for gw if
an ifaddr for dst is not found as the rtsock-based implementation does.

PR: 275341
Reported by: Sean Cody <sean@tinfoilhat.ca>
Reviewed by: rcm
Tested by: rcm
Approved by: kp (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41330

(cherry picked from commit f818559774cb0c1516364c4beca361480fd68b5b)

Details

Provenance
takahiro.kurosawa_gmail.comAuthored on Nov 28 2023, 6:14 PM
zleiCommitted on Mar 14 2024, 8:27 AM
Reviewer
rcm
Differential Revision
D41330: netlink: fix adding an interface route
Parents
rG47ee352ffda9: mount_nullfs(8): fix typo
Branches
Unknown
Tags
Unknown