[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defaultroute
From: |
Armin Wolfermann |
Subject: |
Re: defaultroute |
Date: |
Thu, 8 Jul 2004 17:56:55 +0200 |
User-agent: |
Mutt/1.5.6i |
This is a really quick and dirty patch to make it work:
--- ifconf.c.orig Wed Jun 9 08:59:26 2004
+++ ifconf.c Thu Jul 8 17:48:50 2004
@@ -429,8 +429,23 @@
# if defined HAVE_RTENTRY || defined HAVE_ORTENTRY
-if ((sk = socket(AF_INET,SOCK_RAW,0)) == -1)
+if (VSYSTEMHARDCLASS == freebsd || VSYSTEMHARDCLASS == openbsd)
{
+ ShellCommandReturnsZero("/sbin/route delete default");
+ snprintf(VBUFF,CF_MAXVARSIZE,"/sbin/route add default %s",VDEFAULTROUTE);
+ if (ShellCommandReturnsZero(VBUFF))
+ {
+ CfLog(cfinform,"Setting default route","");
+ CfLog(cfinform,VBUFF,"");
+ }
+ else
+ {
+ CfLog(cferror,"Error setting route","");
+ }
+ return;
+ }
+else if ((sk = socket(AF_INET,SOCK_RAW,0)) == -1)
+ {
if (VSYSTEMHARDCLASS == linuxx)
{
Debug ("No raw socket protocol for linux -- faking with shell
commands\n");