dhcpcd - no default routes
Since I currently have two ISP:s using dhcpcd i had a need for not adding default routes.
Thus I created a patch on the dhcpcd-code.
Patch
diff -r -u dhcpcd-1.3.22-pl3/client.c dhcpcd-1.3.22-pl3-peope1/client.c
--- dhcpcd-1.3.22-pl3/client.c Sun Sep 29 17:52:13 2002
+++ dhcpcd-1.3.22-pl3-peope1/client.c Wed Nov 13 01:58:54 2002
@@ -76,6 +76,7 @@
extern int BeRFC1541;
extern unsigned LeaseTime;
extern int ReplResolvConf;
+extern int SetDefaultRoutes;
extern int ReplNISConf;
extern int ReplNTPConf;
extern int SetDomainName;
@@ -727,6 +728,7 @@
if ( ioctl(dhcpSocket,SIOCADDRT,&rtent) )
syslog(LOG_ERR,"dhcpConfig: ioctl SIOCADDRT: %m\n");
}
+ if ( SetDefaultRoutes )
if ( DhcpOptions.len[routersOnSubnet] > 3 )
for (i=0;i<DhcpOptions.len[routersOnSubnet];i+=4)
{ /* setting default routes */
diff -r -u dhcpcd-1.3.22-pl3/dhcpcd.c dhcpcd-1.3.22-pl3-peope1/dhcpcd.c
--- dhcpcd-1.3.22-pl3/dhcpcd.c Sun Sep 29 18:29:18 2002
+++ dhcpcd-1.3.22-pl3-peope1/dhcpcd.c Wed Nov 13 01:59:07 2002
@@ -55,6 +55,7 @@
int BeRFC1541 = 0;
unsigned LeaseTime = DEFAULT_LEASETIME;
int ReplResolvConf = 1;
+int SetDefaultRoutes= 1;
int ReplNISConf = 1;
int ReplNTPConf = 1;
int SetDomainName = 0;
@@ -144,6 +145,10 @@
case 'R':
s++;
ReplResolvConf=0;
+ goto prgs;
+ case 'G':
+ s++;
+ SetDefaultRoutes=0;
goto prgs;
case 'Y':
s++;
Files
dhcpcd-1.3.22-pl3-peope1.diff
A non statical dhcpcd
Links
http://www.phystech.com/download/dhcpcd.html
Author Per-Olof Pettersson