From owner-freebsd-net@FreeBSD.ORG Thu Mar 4 10:37:38 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 300A616A4CE for ; Thu, 4 Mar 2004 10:37:38 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id D121343D2F for ; Thu, 4 Mar 2004 10:37:37 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i24IaKDL051645; Thu, 4 Mar 2004 13:36:20 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i24IaCOR051638; Thu, 4 Mar 2004 13:36:20 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 4 Mar 2004 13:36:12 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Juan Rodriguez Hervella In-Reply-To: <200403041022.04338.jrh@it.uc3m.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: openVPN question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2004 18:37:38 -0000 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