From f3e4b626be9c579d5cd8105ddecb008a1f8a941e Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 21 Apr 2026 00:39:54 +0900 Subject: [PATCH] libnetwork: expose proxy information in FirewallInfo Signed-off-by: Akihiro Suda --- daemon/libnetwork/controller_linux.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/daemon/libnetwork/controller_linux.go b/daemon/libnetwork/controller_linux.go index ce7fa866d9..6950d736af 100644 --- a/daemon/libnetwork/controller_linux.go +++ b/daemon/libnetwork/controller_linux.go @@ -13,7 +13,8 @@ import ( "github.com/moby/moby/v2/daemon/libnetwork/osl" ) -// FirewallBackend returns the name of the firewall backend for "docker info". +// FirewallBackend returns FirewallInfo for "docker info". +// Despite the name, FirewallInfo may include information about the userland proxy as well. func (c *Controller) FirewallBackend() *system.FirewallInfo { var info system.FirewallInfo info.Driver = "iptables" @@ -26,6 +27,15 @@ func (c *Controller) FirewallBackend() *system.FirewallInfo { info.Info = [][2]string{{"ReloadedAt", reloadedAt.Format(time.RFC3339)}} } } + if c.cfg.EnableUserlandProxy { + // EnableUserlandProxy is exposed in FirewallInfo since Docker v29.5. + // In older versions, EnableUserlandProxy is not included in FirewallInfo, + // but it is still used in most cases as it is enabled by default. + info.Info = append(info.Info, [2]string{"EnableUserlandProxy", "true"}) + if c.cfg.UserlandProxyPath != "" { + info.Info = append(info.Info, [2]string{"UserlandProxyPath", c.cfg.UserlandProxyPath}) + } + } return &info }