]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix --show-gateway for IPv6 on NetBSD/i386.
authorGert Doering <gert@greenie.muc.de>
Sun, 13 Sep 2020 14:56:21 +0000 (16:56 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 14 Sep 2020 07:19:21 +0000 (09:19 +0200)
commit9a695902402faafa343783c38761c4c0ccbb2b83
tree0da1ceb9117ed5e1603d6a782e2a7ee7fc693270
parent5382bdbfbfb9ac26c7c75bc967af86db352b54b3
Fix --show-gateway for IPv6 on NetBSD/i386.

Our ROUNDUP() macro to achieve the required system-specific alignment
for data structures sent to the routing socket was wrong for NetBSD -
unlike OpenBSD/FreeBSD, NetBSD is not using "long" (32/64 bit depending
on OS architecture), and not "uint32_t" either (32/32) like MacOS, but
uint64_t.

So our use of "long" always worked on NetBSD/amd64 and stopped working
on NetBSD/i386 when this was changed on the OS side...

NetBSD conveniently exports a RT_ROUNDUP() macro from <net/route.h> - use
that, and avoid trying to second-guess OS requirements.

While at it, add M_ERRNO to ominous "GDG6: problem writing to routing
socket"
error message to differenciate between "EINVAL" and other errors.

Trac: #734

Signed-off-by: Gert Doering <gert@greenie.net>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20200913145621.12125-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20983.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 37aab49b083a9e385970e3ab2dd727ea1a95ff35)
src/openvpn/route.c