HomeFreeBSD

ndp: cope with unresolved neighbours

Description

ndp: cope with unresolved neighbours

If we've not (yet) resolved a neighbour nda_lladdr will be NULL, and
NLA_DATA_LEN(neigh->nda_lladdr) will dereference a NULL pointer.

Avoid that by checking nda_lladdr first, and only dereferencing if it's
not NULL.

Test case:
ping6 -c 1 <non-existant neighbour>
ndp -a

Reviewed by: melifaro
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41903

(cherry picked from commit b57df6fbcc484f1941bf306cb60a3adaf538df69)

Details

Provenance
kpAuthored on Sep 18 2023, 5:01 PM
Reviewer
melifaro
Differential Revision
D41903: ndp: cope with unresolved neighbours
Parents
rG35e5fd1b286c: zfs: merge openzfs/zfs@62677576a (zfs-2.2-release) into stable/14
Branches
Unknown
Tags
Unknown