summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/ether.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-11-26 22:44:33 +0000
committerBrian Somers <brian@FreeBSD.org>1999-11-26 22:44:33 +0000
commitfdc29d54a48f371bfc1c3af8a6dff0450b6523d0 (patch)
tree02e7ca276db88600b19e1c4e57da792780e09cc1 /usr.sbin/ppp/ether.c
parentda2440e8264eb599767a0926cd6bb18053d05d36 (diff)
downloadsrc-test2-fdc29d54a48f371bfc1c3af8a6dff0450b6523d0.tar.gz
src-test2-fdc29d54a48f371bfc1c3af8a6dff0450b6523d0.zip
Notes
Diffstat (limited to 'usr.sbin/ppp/ether.c')
-rw-r--r--usr.sbin/ppp/ether.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/usr.sbin/ppp/ether.c b/usr.sbin/ppp/ether.c
index b25cfbf8e531..b06a3c2ba132 100644
--- a/usr.sbin/ppp/ether.c
+++ b/usr.sbin/ppp/ether.c
@@ -273,6 +273,7 @@ ether_AwaitCarrier(struct physical *p)
static const struct device baseetherdevice = {
ETHER_DEVICE,
"ether",
+ { CD_REQUIRED, DEF_ETHERCDDELAY },
ether_AwaitCarrier,
ether_RemoveFromSet,
NULL,
@@ -584,13 +585,29 @@ ether_Create(struct physical *p)
return ether_Abandon(dev, p);
}
- dev->timeout = p->cfg.cd.delay;
- dev->connected = CARRIER_PENDING;
-
/* Hook things up so that we monitor dev->cs */
p->desc.UpdateSet = ether_UpdateSet;
p->desc.IsSet = ether_IsSet;
p->desc.Read = ether_DescriptorRead;
+
+ memcpy(&dev->dev, &baseetherdevice, sizeof dev->dev);
+ switch (p->cfg.cd.necessity) {
+ case CD_VARIABLE:
+ dev->dev.cd.delay = p->cfg.cd.delay;
+ break;
+ case CD_REQUIRED:
+ dev->dev.cd = p->cfg.cd;
+ break;
+ case CD_NOTREQUIRED:
+ log_Printf(LogWARN, "%s: Carrier must be set, using ``set cd %d!''\n",
+ p->link.name, dev->dev.cd.delay);
+ case CD_DEFAULT:
+ break;
+ }
+
+ dev->timeout = dev->dev.cd.delay;
+ dev->connected = CARRIER_PENDING;
+
} else {
/* See if we're a netgraph socket */
struct sockaddr_ng ngsock;
@@ -611,6 +628,7 @@ ether_Create(struct physical *p)
return NULL;
}
+ memcpy(&dev->dev, &baseetherdevice, sizeof dev->dev);
dev->cs = -1;
dev->timeout = 0;
dev->connected = CARRIER_OK;
@@ -619,8 +637,6 @@ ether_Create(struct physical *p)
}
if (dev) {
- memcpy(&dev->dev, &baseetherdevice, sizeof dev->dev);
-
physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNCNOACF);
/* Moan about (and fix) invalid LCP configurations */