OpenVPN / OpenVPN/openvpn

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

Open
#529 8 comments 0 reactions 1 assignee View on GitHub

@flichtenheld is already working on this.

Since Apr 8, 2024.

enhancement non-trivial change outdated code
Dominant language
C
Stars
14.6k
Forks
3.4k
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.