Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171560292
D59595.id186477.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
D59595.id186477.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
@@ -245,13 +245,21 @@
* Translate a FreeBSD interface name to a Linux interface name.
*/
static bool
-nlmsg_translate_ifname_nla(struct nlattr *nla, struct nl_writer *nw)
+nlmsg_translate_ifname_nla(struct nlmsghdr *hdr, struct nlattr *nla,
+ struct nl_writer *nw)
{
+ struct ifinfomsg *ifinfo;
char ifname[LINUX_IFNAMSIZ];
if (nw->ifp == NULL)
return (false);
- (void)ifname_bsd_to_linux_ifp(nw->ifp, ifname, sizeof(ifname));
+
+ ifinfo = (struct ifinfomsg *)(hdr + 1);
+ if (if_getindex(__DECONST(if_t, nw->ifp)) == ifinfo->ifi_index)
+ ifname_bsd_to_linux_ifp(nw->ifp, ifname, sizeof(ifname));
+ else if (ifname_bsd_to_linux_idx(ifinfo->ifi_index, ifname,
+ sizeof(ifname)) <= 0)
+ return (nlmsg_copy_nla(nla, nw));
return (nlattr_add_string(nw, IFLA_IFNAME, ifname));
}
@@ -272,7 +280,7 @@
case NL_RTM_GETLINK:
switch (nla->nla_type) {
case IFLA_IFNAME:
- return (nlmsg_translate_ifname_nla(nla, nw));
+ return (nlmsg_translate_ifname_nla(hdr, nla, nw));
default:
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 12, 6:35 PM (2 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38810403
Default Alt Text
D59595.id186477.diff (1 KB)
Attached To
Mode
D59595: compat/linux: fix IFLA_IFNAME translation for multi-message netlink
Attached
Detach File
Event Timeline
Log In to Comment