Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178064793
D54109.1795881780.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D54109.1795881780.diff
View Options
diff --git a/sys/netlink/netlink_ctl.h b/sys/netlink/netlink_ctl.h
--- a/sys/netlink/netlink_ctl.h
+++ b/sys/netlink/netlink_ctl.h
@@ -79,6 +79,7 @@
/* Common helpers */
bool nlp_has_priv(struct nlpcb *nlp, int priv);
struct ucred *nlp_get_cred(struct nlpcb *nlp);
+struct vnet *nlp_get_vnet(struct nlpcb *nlp);
uint32_t nlp_get_pid(const struct nlpcb *nlp);
bool nlp_unconstrained_vnet(const struct nlpcb *nlp);
diff --git a/sys/netlink/netlink_glue.c b/sys/netlink/netlink_glue.c
--- a/sys/netlink/netlink_glue.c
+++ b/sys/netlink/netlink_glue.c
@@ -94,6 +94,12 @@
return (nlp->nl_socket->so_cred);
}
+struct vnet *
+nlp_get_vnet(struct nlpcb *nlp)
+{
+ return (nlp->nl_socket->so_vnet);
+}
+
uint32_t
nlp_get_pid(const struct nlpcb *nlp)
{
diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c
--- a/sys/netlink/route/iface.c
+++ b/sys/netlink/route/iface.c
@@ -679,10 +679,14 @@
return (error);
nl_get_attrs_bmask_nlmsg(hdr, &ifmsg_parser, &bm);
+ CURVNET_SET(nlp_get_vnet(nlp));
if (hdr->nlmsg_flags & NLM_F_CREATE)
- return (create_link(hdr, &attrs, &bm, nlp, npt));
+ error = create_link(hdr, &attrs, &bm, nlp, npt);
else
- return (modify_link(hdr, &attrs, &bm, nlp, npt));
+ error = modify_link(hdr, &attrs, &bm, nlp, npt);
+ CURVNET_RESTORE();
+
+ return (error);
}
static void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 28, 4:03 PM (6 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42069621
Default Alt Text
D54109.1795881780.diff (1 KB)
Attached To
Mode
D54109: netlink: use same cred as caller's cred similar to ifioctl
Attached
Detach File
Event Timeline