Skip to content

Commit 7400f14

Browse files
committed
Netif (DragonFly): use code of OpenBSD
1 parent 8565431 commit 7400f14

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Features:
88
* Improve accuracy of HDR support on Windows 11 24H2 (Display, Windows)
99
* Improve performance of SSID detection on macOS Sequoia (Wifi, macOS, #1597)
1010
* Support warp terminal version detection on Windows (Terminal, Windows)
11-
* Support default route detection for OpenBSD (LocalIP, OpenBSD)
11+
* Support default route detection on OpenBSD & DragonFly BSD (LocalIP, OpenBSD / DragonFly)
1212

1313
Logo:
1414
* Add Common Torizon OS

src/common/netif/netif_bsd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <netinet/in.h>
1010
#include <sys/socket.h>
1111

12-
#ifdef __OpenBSD__
12+
#if defined(__OpenBSD__) || defined(__DragonFly__)
1313
#include <sys/sysctl.h>
1414
#endif
1515

@@ -19,7 +19,7 @@
1919
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
2020
#elif defined(__NetBSD__)
2121
# define ROUNDUP(a) ROUNDUP2((a), sizeof(uint64_t))
22-
#elif defined(__FreeBSD__)
22+
#elif defined(__FreeBSD__) || defined(__DragonFly__)
2323
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
2424
#elif defined(__OpenBSD__)
2525
# define ROUNDUP(a) ROUNDUP2((a), sizeof(int))
@@ -52,7 +52,7 @@ get_rt_address(struct rt_msghdr *rtm, int desired)
5252

5353
bool ffNetifGetDefaultRouteImpl(char iface[IF_NAMESIZE + 1], uint32_t* ifIndex)
5454
{
55-
#if defined(__OpenBSD__)
55+
#if defined(__OpenBSD__) || defined(__DragonFly__)
5656
int mib[6] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_GATEWAY};
5757
size_t needed;
5858

src/modules/localip/localip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ void ffInitLocalIpOptions(FFLocalIpOptions* options)
525525
ffOptionInitModuleArg(&options->moduleArgs, "󰩟");
526526

527527
options->showType = FF_LOCALIP_TYPE_IPV4_BIT | FF_LOCALIP_TYPE_PREFIX_LEN_BIT
528-
#if !__ANDROID__ /*Permission denied*/ && !__DragonFly__ /*Doesn't work*/
528+
#if !__ANDROID__ /*Permission denied*/
529529
| FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT
530530
#endif
531531
;

0 commit comments

Comments
 (0)