Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 2004 13:36:12 -0500 (EST)
From:      Robert Watson <rwatson@freebsd.org>
To:        Juan Rodriguez Hervella <jrh@it.uc3m.es>
Cc:        freebsd-net@freebsd.org
Subject:   Re: openVPN question
Message-ID:  <Pine.NEB.3.96L.1040304133520.49288E-100000@fledge.watson.org>
In-Reply-To: <200403041022.04338.jrh@it.uc3m.es>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu, 4 Mar 2004, Juan Rodriguez Hervella wrote:

>  An James Yonan said:
> > Ah, yes, that's a problem.
> > 
> > The --redirect-gateway implementation needs to be able to get the IP address
> > of the current default gateway.  Unfortunately the standard Berkeley sockets
> > API doesn't give us a portable way of doing this.  Anyone know how to 
> > do this on FreeBSD?
> 
> So ? :) 

Take a look at the implementation of 'route get default' in
src/sbin/route/route.c.  Basically, you ask the routing socket for the
route to 0.0.0.0/0.0.0.0 (INADDR_ANY).

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Senior Research Scientist, McAfee Research




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040304133520.49288E-100000>