Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F165174081
D38715.id117743.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38715.id117743.diff
View Options
diff --git a/sys/compat/linux/linux_netlink.c b/sys/compat/linux/linux_netlink.c
--- a/sys/compat/linux/linux_netlink.c
+++ b/sys/compat/linux/linux_netlink.c
@@ -224,6 +224,20 @@
return (false);
}
+/*
+ * Replace a FreeBSD interface name by a Linux interface name.
+ */
+static bool
+nlmsg_replace_ifname_nla(struct nlattr *nla, struct nl_writer *nw)
+{
+ char ifname[LINUX_IFNAMSIZ];
+
+ if (ifname_bsd_to_linux_name((char *)(nla + 1), ifname,
+ sizeof(ifname)) <= 0)
+ return (false);
+ return (nlattr_add_string(nw, IFLA_IFNAME, ifname));
+}
+
static bool
nlmsg_copy_all_nla(struct nlmsghdr *hdr, int raw_hdrlen, struct nl_writer *nw)
{
@@ -238,8 +252,16 @@
if (nla->nla_len < sizeof(struct nlattr)) {
return (false);
}
- if (!nlmsg_copy_nla(nla, nw))
- return (false);
+ switch (nla->nla_type) {
+ case IFLA_IFNAME:
+ if (!nlmsg_replace_ifname_nla(nla, nw))
+ return (false);
+ break;
+ default:
+ if (!nlmsg_copy_nla(nla, nw))
+ return (false);
+ break;
+ }
}
return (true);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 7, 1:47 PM (2 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36177390
Default Alt Text
D38715.id117743.diff (1 KB)
Attached To
Mode
D38715: linux(4): Fixup the interface name translation in netlink
Attached
Detach File
Event Timeline
Log In to Comment