Skip to content

coredns: fix netlink compat for wgsd plugin#29264

Merged
commodo merged 1 commit intoopenwrt:masterfrom
commodo:fix-coredns-netlink
Apr 29, 2026
Merged

coredns: fix netlink compat for wgsd plugin#29264
commodo merged 1 commit intoopenwrt:masterfrom
commodo:fix-coredns-netlink

Conversation

@commodo
Copy link
Copy Markdown
Contributor

@commodo commodo commented Apr 28, 2026

📦 Package Details

Maintainer: @vooon

Description:

wgsd (WireGuard Service Discovery plugin) pulls in golang.zx2c4.com/wireguard/wgctrl -> mdlayher/genetlink v1.2.0 -> mdlayher/netlink v1.6.2. This version of netlink calls mdlayher/socket's Sendmsg/Recvmsg with the old API signatures (pre-context.Context, single-return-value Sendmsg), but coredns itself requires mdlayher/socket v0.5.1 which changed these signatures to include context.Context and return (int, error).

Add a go get step that upgrades netlink to v1.7.2 after the wgsd plugin dependencies are pulled in, ensuring the build uses a netlink version compatible with socket v0.5.x.

Should fix:
https://downloads.openwrt.org/snapshots/faillogs/i386_pentium-mmx/packages/coredns/compile.txt

  ../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:105:9: too many return values
          have (int, error)
          want (error)
  ../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:105:35: not enough arguments in call to c.s.Sendmsg
          have ([]byte, nil, *"golang.org/x/sys/unix".SockaddrNetlink, number)
          want (context.Context, []byte, []byte, "golang.org/x/sys/unix".Sockaddr, int)
  ../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:116:9: too many return values
          have (int, error)
          want (error)
  ../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:116:33: not enough arguments in call to c.s.Sendmsg
          have ([]byte, nil, *"golang.org/x/sys/unix".SockaddrNetlink, number)
          want (context.Context, []byte, []byte, "golang.org/x/sys/unix".Sockaddr, int)
  ../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:127:42: not enough arguments in call to c.s.Recvmsg
          have ([]byte, nil, number)
          want (context.Context, []byte, []byte, int)
  ../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:142:41: not enough arguments in call to c.s.Recvmsg
          have ([]byte, nil, number)
          want (context.Context, []byte, []byte, int)
  github.com/aws/aws-sdk-go-v2/aws/protocol/query
  github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding
  github.com/aws/smithy-go/private/requestcompression

🧪 Run Testing Details

  • OpenWrt Version:
  • OpenWrt Target/Subtarget:
  • OpenWrt Device:

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

wgsd (WireGuard Service Discovery plugin) pulls in
golang.zx2c4.com/wireguard/wgctrl -> mdlayher/genetlink v1.2.0 ->
mdlayher/netlink v1.6.2. This version of netlink calls
mdlayher/socket's Sendmsg/Recvmsg with the old API signatures
(pre-context.Context, single-return-value Sendmsg), but coredns
itself requires mdlayher/socket v0.5.1 which changed these
signatures to include context.Context and return (int, error).

Add a go get step that upgrades netlink to v1.7.2 after the wgsd
plugin dependencies are pulled in, ensuring the build uses a
netlink version compatible with socket v0.5.x.

Should fix:
  https://downloads.openwrt.org/snapshots/faillogs/i386_pentium-mmx/packages/coredns/compile.txt

```
../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:105:9: too many return values
	have (int, error)
	want (error)
../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:105:35: not enough arguments in call to c.s.Sendmsg
	have ([]byte, nil, *"golang.org/x/sys/unix".SockaddrNetlink, number)
	want (context.Context, []byte, []byte, "golang.org/x/sys/unix".Sockaddr, int)
../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:116:9: too many return values
	have (int, error)
	want (error)
../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:116:33: not enough arguments in call to c.s.Sendmsg
	have ([]byte, nil, *"golang.org/x/sys/unix".SockaddrNetlink, number)
	want (context.Context, []byte, []byte, "golang.org/x/sys/unix".Sockaddr, int)
../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:127:42: not enough arguments in call to c.s.Recvmsg
	have ([]byte, nil, number)
	want (context.Context, []byte, []byte, int)
../../../../../dl/go-mod-cache/github.com/mdlayher/netlink@v1.6.2/conn_linux.go:142:41: not enough arguments in call to c.s.Recvmsg
	have ([]byte, nil, number)
	want (context.Context, []byte, []byte, int)
github.com/aws/aws-sdk-go-v2/aws/protocol/query
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding
github.com/aws/smithy-go/private/requestcompression
```

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
@commodo commodo force-pushed the fix-coredns-netlink branch from 6441591 to aa373d9 Compare April 28, 2026 07:01
@commodo commodo merged commit 3b680cc into openwrt:master Apr 29, 2026
12 checks passed
@commodo commodo deleted the fix-coredns-netlink branch April 29, 2026 03:42
@vooon
Copy link
Copy Markdown
Contributor

vooon commented Apr 29, 2026

Thanks! I'm no longer using it... Unfortunately CGNAT on both sides and huge filtering makes it unusable for me.
My attempt to re-implement wgsd on ucode failed because of that (while it's workable and much smaller footprint).
Now i'm using several p2p links in hub-and-spoke model with bgp on top...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants