NetBSD Problem Report #45394

From  Fri Sep 23 06:53:08 2011
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 0008063B884
	for <>; Fri, 23 Sep 2011 06:53:07 +0000 (UTC)
Message-Id: <>
Date: Fri, 23 Sep 2011 06:45:10 +0000 (UTC)
Subject: openvpn get_default_gateway() fails on NetBSD
X-Send-Pr-Version: 3.95

>Number:         45394
>Category:       pkg
>Synopsis:       openvpn get_default_gateway() fails on NetBSD
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 23 06:55:00 +0000 2011
>Originator:     Alan Barrett
>Release:        NetBSD 5.99.55
Not much
System: NetBSD 5.99.55
Architecture: i386
Machine: i386

openvpn-2.2.1 built from pkgsrc contains code to find the
default gateway, but it fails on NetBSD-current, resulting in
log messages like this:

	NOTE: unable to redirect default gateway -- Cannot read current
	default gateway from system

Build and install openvpn on NetBSD-current.  Attempt to use it with a
configuration that includes constructs like this:

	--redirect-gateway def1
	--route net_gateway

The system's default IPv4 gateway is needed by both the the
--redirect-gateway option, and the net_gateway keyword used with the
--route option.

Change the code in openvpn-2.2.1/route.c to use the correct API on

There are several versions of the get_default_gateway() function
in route.c.  The culprit seems to be the one guarded by

	#elif defined(TARGET_OPENBSD) || defined(TARGET_NETBSD)

in line 1933 of route.c.

I haven't investigated in detail, but it's suspicious that openvpn uses
it's own struct definitions instead of including appropriate headers
from the system.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.