Skip to content

Commit

Permalink
Set the default VNET in krping before calling ifunit_ref(). Else usin…
Browse files Browse the repository at this point in the history
…g IPv6

link-local addresses when VIMAGE is enabled will cause a so-called NULL
pointer dereferencing issue.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
  • Loading branch information
hselasky committed Nov 14, 2017
1 parent 760c3a1 commit 4591fd4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sys/contrib/rdma/krping/krping.c
Original file line number Diff line number Diff line change
Expand Up @@ -3185,7 +3185,9 @@ krping_get_ipv6_scope_id(char *name)

if (name == NULL)
return (0);
CURVNET_SET_QUIET(TD_TO_VNET(curthread));
ifp = ifunit_ref(name);
CURVNET_RESTORE();
if (ifp == NULL)
return (0);
retval = ifp->if_index;
Expand Down

0 comments on commit 4591fd4

Please sign in to comment.