Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148389123
D41585.id126482.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
D41585.id126482.diff
View Options
diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c
--- a/sbin/ifconfig/af_link.c
+++ b/sbin/ifconfig/af_link.c
@@ -165,17 +165,6 @@
}
#else
-static uint8_t
-convert_iftype(uint8_t iftype)
-{
- switch (iftype) {
- case IFT_IEEE8023ADLAG:
- return (IFT_ETHER);
- case IFT_INFINIBANDLAG:
- return (IFT_INFINIBAND);
- }
- return (iftype);
-}
static void
link_status_nl(if_ctx *ctx, if_link_t *link, if_addr_t *ifa __unused)
diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h
--- a/sbin/ifconfig/ifconfig.h
+++ b/sbin/ifconfig/ifconfig.h
@@ -38,6 +38,7 @@
#include <libifconfig.h>
#include <stdbool.h>
+#include <net/if_types.h>
#define __constructor __attribute__((constructor))
@@ -279,6 +280,7 @@
void af_other_status(if_ctx *ctx);
void print_ifstatus(if_ctx *ctx);
void print_metric(if_ctx *ctx);
+ifType convert_iftype(ifType iftype);
/* Netlink-related functions */
void list_interfaces_nl(struct ifconfig_args *args);
diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c
--- a/sbin/ifconfig/ifconfig_netlink.c
+++ b/sbin/ifconfig/ifconfig_netlink.c
@@ -224,6 +224,19 @@
return (link.ifi_index);
}
+ifType
+convert_iftype(ifType iftype)
+{
+ switch (iftype) {
+ case IFT_IEEE8023ADLAG:
+ return (IFT_ETHER);
+ case IFT_INFINIBANDLAG:
+ return (IFT_INFINIBAND);
+ default:
+ return (iftype);
+ }
+}
+
static void
prepare_ifaddrs(struct snl_state *ss, struct ifmap *ifmap)
{
@@ -282,7 +295,7 @@
struct sockaddr_dl sdl = {
.sdl_len = sizeof(struct sockaddr_dl),
.sdl_family = AF_LINK,
- .sdl_type = link->ifi_type,
+ .sdl_type = convert_iftype(link->ifi_type),
.sdl_alen = NLA_DATA_LEN(link->ifla_address),
};
return (match_ether(&sdl));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 1:17 PM (9 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29907520
Default Alt Text
D41585.id126482.diff (1 KB)
Attached To
Mode
D41585: ifconfig: fix 'ifconfig -l ether'
Attached
Detach File
Event Timeline
Log In to Comment