HomeFreeBSD

link_addr: be more strict about address formats

Description

link_addr: be more strict about address formats

instead of accepting any character as a delimiter, only accept ':', '.'
and '-', and only permit a single delimiter in an address.

this prevents accepting bizarre addresses like:

ifconfig epair2a link 10.1.2.200/28

... which is particularly problematic on an INET6-only system, in which
case ifconfig defaults to the 'link' family, meaning that:

ifconfig epair2a 10.1.2.200/28

... changes the Ethernet address of the interface.

bump __FreeBSD_version so link_addr() consumers can detect the change.

Reviewed by: kp, des
Approved by: des (mentor)
Differential Revision: https://reviews.freebsd.org/D49936

(cherry picked from commit a1215090416b8afb346fb2ff5b38f25ba0134a3a)

Details

Provenance
ivyAuthored on Wed, May 14, 10:02 PM
Reviewer
kp
Differential Revision
D49936: link_addr: only accept '.' and ':' as separators
Parents
rG054468aa45d0: net/if_dl.h: add param names in prototypes
Branches
Unknown
Tags
Unknown