Netif (DragonFly): use code of OpenBSD

This commit is contained in:
李通洲
2025-03-14 23:41:09 +08:00
parent 85654316c7
commit 7400f14322
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ Features:
* Improve accuracy of HDR support on Windows 11 24H2 (Display, Windows)
* Improve performance of SSID detection on macOS Sequoia (Wifi, macOS, #1597)
* Support warp terminal version detection on Windows (Terminal, Windows)
* Support default route detection for OpenBSD (LocalIP, OpenBSD)
* Support default route detection on OpenBSD & DragonFly BSD (LocalIP, OpenBSD / DragonFly)
Logo:
* Add Common Torizon OS
+3 -3
View File
@@ -9,7 +9,7 @@
#include <netinet/in.h>
#include <sys/socket.h>
#ifdef __OpenBSD__
#if defined(__OpenBSD__) || defined(__DragonFly__)
#include <sys/sysctl.h>
#endif
@@ -19,7 +19,7 @@
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
#elif defined(__NetBSD__)
# define ROUNDUP(a) ROUNDUP2((a), sizeof(uint64_t))
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__DragonFly__)
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
#elif defined(__OpenBSD__)
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
@@ -52,7 +52,7 @@ get_rt_address(struct rt_msghdr *rtm, int desired)
bool ffNetifGetDefaultRouteImpl(char iface[IF_NAMESIZE + 1], uint32_t* ifIndex)
{
#if defined(__OpenBSD__)
#if defined(__OpenBSD__) || defined(__DragonFly__)
int mib[6] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_GATEWAY};
size_t needed;
+1 -1
View File
@@ -525,7 +525,7 @@ void ffInitLocalIpOptions(FFLocalIpOptions* options)
ffOptionInitModuleArg(&options->moduleArgs, "󰩟");
options->showType = FF_LOCALIP_TYPE_IPV4_BIT | FF_LOCALIP_TYPE_PREFIX_LEN_BIT
#if !__ANDROID__ /*Permission denied*/ && !__DragonFly__ /*Doesn't work*/
#if !__ANDROID__ /*Permission denied*/
| FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT
#endif
;