From ac2215ca09fa6683037d5ce3c603090d71b82642 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 15 Jun 2022 21:07:50 -0400 Subject: [PATCH] ifconfig: Place generic options at the end of the media types list. Otherwise we will get "Auto-select" even if something more specific applies, e.g. in the case of IFM_IEEE80211 at least. Fixes media type detection for OpenBSD drivers. --- src/bin/network/ifconfig/MediaTypes.cpp | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/bin/network/ifconfig/MediaTypes.cpp b/src/bin/network/ifconfig/MediaTypes.cpp index 11c45b04d1..14a5d34c12 100644 --- a/src/bin/network/ifconfig/MediaTypes.cpp +++ b/src/bin/network/ifconfig/MediaTypes.cpp @@ -39,23 +39,6 @@ struct media_type { const media_type kMediaTypes[] = { - { - 0, // for generic options - "all", - "All", - IFM_TMASK, - { - { IFM_AUTO, "auto", "Auto-select" }, - { -1, NULL, NULL } - }, - { - { IFM_FDX, true, "fullduplex", "Full Duplex" }, - { IFM_HDX, true, "halfduplex", "Half Duplex" }, - { IFM_LOOP, true, "loop", "Loop" }, - //{ IFM_ACTIVE, false, "active", "Active" }, - { -1, false, NULL, NULL } - } - }, { IFM_ETHER, "ether", @@ -99,6 +82,23 @@ const media_type kMediaTypes[] = { { -1, false, NULL, NULL } } }, + { + 0, // for generic options + "all", + "All", + IFM_TMASK, + { + { IFM_AUTO, "auto", "Auto-select" }, + { -1, NULL, NULL } + }, + { + { IFM_FDX, true, "fullduplex", "Full Duplex" }, + { IFM_HDX, true, "halfduplex", "Half Duplex" }, + { IFM_LOOP, true, "loop", "Loop" }, + //{ IFM_ACTIVE, false, "active", "Active" }, + { -1, false, NULL, NULL } + } + }, { -1, NULL, NULL, -1, {{ -1, NULL, NULL }}, {{ -1, false, NULL, NULL }} } };