Opened 10 years ago

Last modified 9 years ago

#360 new Bug / Defect

on linux server, --proto udp is ipv4-only

Reported by: Gert Döring Owned by: plaisthos
Priority: minor Milestone: release 2.4
Component: Generic / unclassified Version: OpenVPN git master branch (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords: ipv6 dual-stack listen getaddrinfo
Cc: tore


On Linux, an UDP server configured with "--proto udp" will open an IPv4-only socket (most likely due to getaddrinfo(AI_PASSIVE) returning INADDR_ANY).

This is different from other platforms (on FreeBSD, it will open a dual-stack udp46 socket), and violates the expectation that "proto udp" should not fix one specific AFI.

This does not affect the 2.3 branch (proto udp there was defined to be ipv4-only, and proto udp4 was not available), only git master after commit 8832c6c4cf7d14256.

A workaround is available, but we should fix it before 2.4 anyway.

Change History (2)

comment:1 Changed 9 years ago by ValdikSS

It is possible to use proto udp6 and tcp6 which would bind IPv6 socket which can accept IPv4 connections if net.ipv6.bindv6only=0 (as its by default). It's not documented though.

comment:2 Changed 9 years ago by Gert Döring

Yeah, udp6/tcp6 (if bindv6only=0) work fine across all platforms except OpenBSD, it's just "plain udp" which behaves differently - thanks for resurrecting this ticket, it totally slipped my mind...

Arne, shall we just document it for the server socket, or try to make the behaviour uniform across platforms?

Note: See TracTickets for help on using tickets.