From 1274c8c833f1a49aac31db1af47a9ed716c4f59b Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 16 Nov 1999 21:57:48 +0000 Subject: Remove some extraneous ifdefs, and don't try to put the socket in O_NONBLOCK. The select() is the best best as I don't want to muck about with the send/receive thresholds. --- usr.sbin/ppp/ether.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'usr.sbin/ppp/ether.c') diff --git a/usr.sbin/ppp/ether.c b/usr.sbin/ppp/ether.c index 52ae083..14ec99a 100644 --- a/usr.sbin/ppp/ether.c +++ b/usr.sbin/ppp/ether.c @@ -53,9 +53,7 @@ #endif #include #include -#ifndef NONBLOCK_FIXED #include -#endif #include #include "layer.h" @@ -204,21 +202,17 @@ ether_MessageIn(struct etherdevice *dev) struct ngpppoe_sts *sts = (struct ngpppoe_sts *)(msgbuf + sizeof *rep); char unknown[14]; const char *msg; -#ifndef NONBLOCK_FIXED struct timeval t; fd_set r; -#endif if (dev->cs < 0) return; -#ifndef NONBLOCK_FIXED FD_ZERO(&r); FD_SET(dev->cs, &r); t.tv_sec = t.tv_usec = 0; if (select(dev->cs + 1, &r, NULL, NULL, &t) <= 0) return; -#endif if (NgRecvMsg(dev->cs, rep, sizeof msgbuf, NULL) < 0) return; @@ -407,7 +401,7 @@ ether_Create(struct physical *p) struct ngm_connect ngc; const char *iface, *provider; char *path, etherid[12]; - int ifacelen, providerlen, oldflag; + int ifacelen, providerlen; char connectpath[sizeof dev->hook + 2]; /* .: */ p->fd--; /* We own the device - change fd */ @@ -590,20 +584,6 @@ ether_Create(struct physical *p) return ether_Abandon(dev, p); } - /* - * Now make our control socket non-blocking so that we can read() - * without having to select() - * - * XXX: Does this work (#define NONBLOCK_FIXED) ? - */ - oldflag = fcntl(dev->cs, F_GETFL, 0); - if (oldflag < 0) { - log_Printf(LogWARN, "%s: Open: Cannot get physical flags: %s\n", - p->link.name, strerror(errno)); - return ether_Abandon(dev, p); - } else - fcntl(dev->cs, F_SETFL, oldflag & ~O_NONBLOCK); - dev->timeout = p->cfg.cd.delay; dev->connected = CARRIER_PENDING; -- cgit v1.1