mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
linux: require vnet(9) context in ifname_bsd_to_linux_name()
This function is used by netlink(9) only. The netlink(9) taskqueue thread runs in the vnet of the socket whose request the thread is processing right now. This is a correct vnet and resetting it to vnet0 is incorrect. If the function is to be used by any other caller in addition to netlink(9), it would be caller's responsiblity to provide correct vnet(9). Reviewed by: melifaro, dchagin Differential Revision: https://reviews.freebsd.org/D44191 PR: 277286 (cherry picked from commit 2f5a315b307447f91891c96fb23c7333fa406f2f)
This commit is contained in:
parent
0148ccb95a
commit
f45ecf5fe4
1 changed files with 2 additions and 2 deletions
|
|
@ -253,14 +253,14 @@ ifname_bsd_to_linux_name(const char *bsdname, char *lxname, size_t len)
|
|||
struct ifnet *ifp;
|
||||
int ret;
|
||||
|
||||
CURVNET_ASSERT_SET();
|
||||
|
||||
ret = 0;
|
||||
CURVNET_SET(TD_TO_VNET(curthread));
|
||||
NET_EPOCH_ENTER(et);
|
||||
ifp = ifunit(bsdname);
|
||||
if (ifp != NULL)
|
||||
ret = ifname_bsd_to_linux_ifp(ifp, lxname, len);
|
||||
NET_EPOCH_EXIT(et);
|
||||
CURVNET_RESTORE();
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue