aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Teske <dteske@FreeBSD.org>2026-08-11 17:29:53 +0000
committerDevin Teske <dteske@FreeBSD.org>2026-08-11 17:29:53 +0000
commit34718e01869b9ce0baf9c859fafe9d54f785464f (patch)
treeebadbd40656712964aff319b92f5672c99bad62a
parentb9db5a5b16477863654f92ec653e8464528ef981 (diff)
linuxulator: map IFF_LOWER_UP through NETLINK_ROUTE for Linux apps
rtnl_if_flags_to_linux() translated the usual IFF_* bits but dropped FreeBSD's IFF_LOWER_UP (IFF_NETLINK_1). Chromium's AddressTrackerLinux only treats a link as online when ifi_flags has UP|LOWER_UP|RUNNING; with LOWER_UP missing, online_links stays empty, ConnectionType is CONNECTION_NONE, and navigator.onLine is false even though TCP/HTTPS work. Linux Chromium under the Linuxulator (e.g. www/linux-brave) then shows a spurious Offline UI; sites that ignore navigator.onLine do not. Native www/chromium is on a different notifier path. Map IFF_LOWER_UP to Linux's IFF_LOWER_UP (1<<16) and define LINUX_IFF_LOWER_UP alongside the existing LINUX_IFF_* constants. PR: 297424 Reviewed by: pouria, adrian (previous revision) Differential Revision: https://reviews.freebsd.org/D58774
-rw-r--r--sys/compat/linux/linux.h3
-rw-r--r--sys/compat/linux/linux_netlink.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h
index a9f753cd55b7..0c46860a6b36 100644
--- a/sys/compat/linux/linux.h
+++ b/sys/compat/linux/linux.h
@@ -124,6 +124,9 @@ struct l_sockaddr {
#define LINUX_IFF_PORTSEL 0x2000
#define LINUX_IFF_AUTOMEDIA 0x4000
#define LINUX_IFF_DYNAMIC 0x8000
+/* Volatile (netlink / ifinfomsg); not representable in ifr_flags short */
+#define LINUX_IFF_LOWER_UP 0x10000
+#define LINUX_IFF_DORMANT 0x20000
/* sigaltstack */
#define LINUX_SS_ONSTACK 1
diff --git a/sys/compat/linux/linux_netlink.c b/sys/compat/linux/linux_netlink.c
index 256f188385ce..8c1659cb1dd8 100644
--- a/sys/compat/linux/linux_netlink.c
+++ b/sys/compat/linux/linux_netlink.c
@@ -342,8 +342,11 @@ rtnl_if_flags_to_linux(unsigned int if_flags)
case IFF_DYING:
/* No Linux analogue */
break;
+ case IFF_LOWER_UP: /* IFF_NETLINK_1 */
+ result |= LINUX_IFF_LOWER_UP;
+ break;
case IFF_MULTICAST:
- result |= 1 << 12;
+ result |= LINUX_IFF_MULTICAST;
}
}
return (result);