Browse Source

need to add default gateway

r432
master
David Whedon 22 years ago
parent
commit
ec40d92878
  1. 1
      TODO
  2. 6
      debian/changelog
  3. 25
      netcfg-static.c

1
TODO

@ -1,3 +1,4 @@
* put in checks so the user can't enter data that is clearly invalid (perhaps this will be done through debconf.
* do other sorts of network configurations (pcmcia, ppp)
* pppconfig would be a good starting point for the ppp udeb. There is also an example in there of how to use pppd to detect a modem.
* netkit-tiny's route is currently in /usr/bin/, it will probably get moved to /sbin, this package will have to be updated.

6
debian/changelog

@ -1,3 +1,9 @@
netcfg (0.07) unstable; urgency=low
* if a gateway is specified, netcfg-static needs to add a default route
-- David Whedon <dwhedon@debian.org> Tue, 30 Jan 2001 23:30:18 -0800
netcfg (0.06) unstable; urgency=low
* added German translations from Michael Bramer <grisu@debian.org> (Closes: #83153, #83159)

25
netcfg-static.c

@ -118,7 +118,8 @@ netcfg_write_static ()
fprintf (fp, "\tnetmask %s\n", num2dot (netmask));
fprintf (fp, "\tnetwork %s\n", num2dot (network));
fprintf (fp, "\tbroadcast %s\n", num2dot (broadcast));
fprintf (fp, "\tgateway %s\n", num2dot (gateway));
if (gateway)
fprintf (fp, "\tgateway %s\n", num2dot (gateway));
fclose (fp);
}
else
@ -132,7 +133,7 @@ error:
static int
netcfg_activate_static ()
{
int rv;
int rv = 0;
char *ptr;
char buf[128];
execlog ("/sbin/ifconfig lo 127.0.0.1");
@ -148,12 +149,24 @@ netcfg_activate_static ()
snprintf (ptr, sizeof (buf) - (ptr - buf), " broadcast %s",
num2dot (broadcast));
rv = execlog (buf);
rv |= execlog (buf);
if (gateway)
{
ptr = buf;
ptr +=
snprintf (buf, sizeof (buf), "/usr/bin/route add default gateway %s",
num2dot (gateway));
rv |= execlog (buf);
}
if (rv != 0)
{
client->command (client, "input", "critical", "netcfg/error_cfg", NULL);
{
client->command (client, "input",
"critical", "netcfg/error_cfg", NULL);
client->command (client, "go", NULL);
}
}
return 0;
}

Loading…
Cancel
Save