Howdies
This applies to route.c in diald-0.99.1
This (attached) diff just changes route.c to prevent diald from adding the
duplicate route in 2.2 kernels and doesn't attempt to change the route
metrics, which 2.2 kernels don't like either. NOTE this will probably break
on systems using 2.0.x kernels. Dunno cos I haven't tested it.
I've tested it on my system and it works fine. I'm using 2.2.13 kernel. For
reference, my diald.conf looks like this:
fifo /etc/diald/diald.ctl
mode ppp
pppd-options name you_must_be_joking
connect /etc/diald/connect.diald
device /dev/ttyS0
crtscts
speed 115200
modem
buffer-packets
lock
local 192.168.0.1
remote 192.168.0.2
dynamic
defaultroute
include /etc/diald/standard.filter
bye
John
--- route.c Wed Jun 2 00:49:55 1999
+++ route.c.new Thu Dec 23 11:10:55 1999
@@ -28,7 +28,10 @@
else
sprintf(win,"window %d",window);
-#if 1
+/*
+ def'ed out for 2.2 kernels
+*/
+#if 0
/* FIXME: this is only needed for 2.0 kernels. 2.2 and beyond
* create routes automatically when the interface is configured.
* On 2.2 and later kernels this just creates some annoying
@@ -37,44 +40,44 @@
*/
if (rip) {
if (path_ip && *path_ip) {
- sprintf(buf,"%s route add %s dev %s scope link%s%s metric %d %s",
+ sprintf(buf,"%s route add %s dev %s scope link%s%s %s",
path_ip, rip, iface,
lip ? " src " : "",
lip ? lip : "",
- metric, win);
+ win);
} else {
- sprintf(buf,"%s add %s metric %d %s dev %s",
- path_route, rip, metric, win, iface);
+ sprintf(buf,"%s add %s %s dev %s",
+ path_route, rip, win, iface);
}
run_shell(SHELL_WAIT, desc, buf, -1);
if (metric) {
if (path_ip && *path_ip) {
- sprintf(buf,"%s route del %s dev %s scope link%s%s metric 0 %s",
+ sprintf(buf,"%s route del %s dev %s scope link%s%s %s",
path_ip, rip, iface,
lip ? " src " : "",
lip ? lip : "",
win);
} else {
- sprintf(buf,"%s del %s metric 0 %s dev %s",
+ sprintf(buf,"%s del %s %s dev %s",
path_route, rip, win, iface);
}
run_shell(SHELL_WAIT, desc, buf, -1);
}
-#endif
}
+#endif
/* Add in a default route for the link if required. */
if (default_route) {
if (path_ip && *path_ip) {
- sprintf(buf, "%s route add default dev %s scope link%s%s metric %d %s",
+ sprintf(buf, "%s route add default dev %s scope link%s%s %s",
path_ip, iface,
lip ? " src " : "",
lip ? lip : "",
- metric, win);
+ win);
} else {
- sprintf(buf,"%s add default metric %d %s netmask 0.0.0.0 dev %s",
- path_route, metric, win, iface);
+ sprintf(buf,"%s add default %s netmask 0.0.0.0 dev %s",
+ path_route, win, iface);
}
run_shell(SHELL_WAIT, desc, buf, -1);
}
@@ -112,14 +115,14 @@
if (default_route) {
if (path_ip && *path_ip) {
- sprintf(buf, "%s route del default dev %s scope link%s%s metric %d",
+ sprintf(buf, "%s route del default dev %s scope link%s%s",
path_ip, iface,
lip ? " src " : "",
- lip ? lip : "",
- metric);
+ lip ? lip : ""
+ );
} else {
- sprintf(buf, "%s del default metric %d netmask 0.0.0.0 dev %s",
- path_route, metric, iface);
+ sprintf(buf, "%s del default netmask 0.0.0.0 dev %s",
+ path_route, iface);
}
run_shell(SHELL_WAIT, desc, buf, -1);
}
@@ -151,14 +154,14 @@
/* With no ifsetup script we have to do it all ourselves. */
if (lip) {
- sprintf(buf,"%s %s %s%s%s%s%s netmask %s metric %d mtu %d up",
+ sprintf(buf,"%s %s %s%s%s%s%s netmask %s mtu %d up",
path_ifconfig, iface, lip,
rip ? " pointopoint " : "",
rip ? rip : "",
bip ? " broadcast " : "",
bip ? bip : "",
netmask ? netmask : "255.255.255.255",
- metric, mtu);
+ mtu);
run_shell(SHELL_WAIT, desc, buf, -1);
}