#529·openvpn

p2p tun configs break with new topology default in non-obvious ways

Author: cron2Created Apr 3, 2024Updated Sep 22, 2026
Labelsenhancementnon-trivial changeoutdated code

so there's a p2p tun config with

ifconfig 10.204.8.1 10.204.8.2

and with commit 32e6586687 the new default is now topology subnet. This leads to the instance no longer starting, with

Apr  3 18:17:06 gentoo tun-udp-p2p[11730]: do_ifconfig, ipv4=1, ipv6=1
Apr  3 18:17:06 gentoo tun-udp-p2p[11730]: net_addr_v4_add: 10.204.8.1/-1 dev tun7
Apr  3 18:17:06 gentoo tun-udp-p2p[11730]: sitnl_send: rtnl: generic error (-22): Invalid argument
Apr  3 18:17:06 gentoo tun-udp-p2p[11730]: Linux can't add IP to interface tun7
Apr  3 18:17:06 gentoo tun-udp-p2p[11730]: Exiting due to fatal error

so it seems "something" is trying to convert the second argument to a netmask/netbits, failing, assigning "-1" to "something" and passing that to sitnl...

This is a config with no client or server, just plain p2p udp, so it surprised me a bit that topology would be relevant here - but quite obviously it changes the interpretation of ifconfig.

So there's two questions here

  • can we make the error message less obviously "the parser did not expect this and put -1 into something which didn't care"?
  • should we keep the topology at net30 for point-to-point configs (no server)? Which is, of course, much more work than just changing the global default for all...

@ordex for the parser, @flichtenheld for the topology default.