summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/network.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-06-12 17:09:34 +0000
committerjkh <jkh@FreeBSD.org>1996-06-12 17:09:34 +0000
commit019fedf51406787d3904598e45f5a867d406becb (patch)
tree1c95f427eede7e1fd7265bac0eb2b60feb5c7a59 /usr.sbin/sysinstall/network.c
parent5385a16e568ad4f2389c1e970e693ac8f1b2c702 (diff)
downloadFreeBSD-src-019fedf51406787d3904598e45f5a867d406becb.zip
FreeBSD-src-019fedf51406787d3904598e45f5a867d406becb.tar.gz
Dispense with the special case handling of cuaa* devices by synthesizing
separate entries for sl0 and ppp0 on each device.
Diffstat (limited to 'usr.sbin/sysinstall/network.c')
-rw-r--r--usr.sbin/sysinstall/network.c80
1 files changed, 37 insertions, 43 deletions
diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c
index 0349321..75b8474 100644
--- a/usr.sbin/sysinstall/network.c
+++ b/usr.sbin/sysinstall/network.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: network.c,v 1.11 1996/04/23 01:29:29 jkh Exp $
+ * $Id: network.c,v 1.12 1996/04/28 20:54:04 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -51,7 +51,6 @@ mediaInitNetwork(Device *dev)
int i;
char *rp;
char *cp, ifconfig[64];
- char ifname[255];
if (!RunningAsInit || networkInitialized)
return TRUE;
@@ -65,58 +64,52 @@ mediaInitNetwork(Device *dev)
kill((pid_t)dev->private, SIGTERM);
dev->private = NULL;
}
- if (!strncmp("cuaa", dev->name, 4)) {
- if (!msgYesNo("You have selected a serial-line network interface.\n"
- "Do you want to use PPP with it?")) {
- if (!(dev->private = (void *)startPPP(dev))) {
- msgConfirm("Unable to start PPP! This installation method cannot be used.");
- return FALSE;
- }
- networkInitialized = TRUE;
- return TRUE;
+ if (!strncmp("ppp", dev->name, 3)) { /* PPP? */
+ if (!(dev->private = (void *)startPPP(dev))) {
+ msgConfirm("Unable to start PPP! This installation method cannot be used.");
+ return FALSE;
}
- else {
- char *val;
- char attach[256];
+ networkInitialized = TRUE;
+ return TRUE;
+ }
+ else if (!strncmp("sl", dev->name, 2)) { /* SLIP? */
+ char *val;
+ char attach[256];
- /* Cheesy slip attach */
- snprintf(attach, 256, "slattach -a -h -l -s 9600 %s", dev->devname);
- val = msgGetInput(attach,
- "Warning: SLIP is rather poorly supported in this revision\n"
- "of the installation due to the lack of a dialing utility.\n"
- "If you can use PPP for this instead then you're much better\n"
- "off doing so, otherwise SLIP works fairly well for *hardwired*\n"
- "links. Please edit the following slattach command for\n"
- "correctness (default here is: VJ compression, Hardware flow-\n"
- "control, ignore carrier and 9600 baud data rate). When you're\n"
- "ready, press [ENTER] to execute it.");
- if (!val)
- return FALSE;
- else
- strcpy(attach, val);
- if (vsystem(attach)) {
- msgConfirm("slattach returned a bad status! Please verify that\n"
- "the command is correct and try again.");
- return FALSE;
- }
+ /* Cheesy slip attach */
+ snprintf(attach, 256, "slattach -a -h -l -s 9600 %s", dev->devname);
+ val = msgGetInput(attach,
+ "Warning: SLIP is rather poorly supported in this revision\n"
+ "of the installation due to the lack of a dialing utility.\n"
+ "If you can use PPP for this instead then you're much better\n"
+ "off doing so, otherwise SLIP works fairly well for *hardwired*\n"
+ "links. Please edit the following slattach command for\n"
+ "correctness (default here is: VJ compression, Hardware flow-\n"
+ "control, ignore carrier and 9600 baud data rate). When you're\n"
+ "ready, press [ENTER] to execute it.");
+ if (!val)
+ return FALSE;
+ else
+ strcpy(attach, val);
+ if (vsystem(attach)) {
+ msgConfirm("slattach returned a bad status! Please verify that\n"
+ "the command is correct and try again.");
+ return FALSE;
}
- strcpy(ifname, "sl0");
}
- else
- strcpy(ifname, dev->name);
snprintf(ifconfig, 255, "%s%s", VAR_IFCONFIG, dev->name);
cp = variable_get(ifconfig);
if (!cp) {
msgConfirm("The %s device is not configured. You will need to do so\n"
- "in the Networking configuration menu before proceeding.", ifname);
+ "in the Networking configuration menu before proceeding.", dev->name);
return FALSE;
}
- msgNotify("Configuring network device %s.", ifname);
- i = vsystem("ifconfig %s %s", ifname, cp);
+ msgNotify("Configuring network device %s.", dev->name);
+ i = vsystem("ifconfig %s %s", dev->name, cp);
if (i) {
msgConfirm("Unable to configure the %s interface!\n"
- "This installation method cannot be used.", ifname);
+ "This installation method cannot be used.", dev->name);
return FALSE;
}
@@ -143,7 +136,8 @@ mediaShutdownNetwork(Device *dev)
return;
msgDebug("Shutdown called for network device %s\n", dev->name);
- if (strncmp("cuaa", dev->name, 4)) {
+ /* Not a serial device? */
+ if (strncmp("sl", dev->name, 2) && strncmp("ppp", dev->name, 3)) {
int i;
char ifconfig[255];
@@ -162,7 +156,7 @@ mediaShutdownNetwork(Device *dev)
}
networkInitialized = FALSE;
}
- else if (dev->private) {
+ else if (dev->private) { /* ppp sticks its PID there */
msgNotify("Killing PPP process %d.", (int)dev->private);
kill((pid_t)dev->private, SIGTERM);
dev->private = NULL;
OpenPOWER on IntegriCloud