diff options
author | brian <brian@cvs.openbsd.org> | 1999-05-24 16:39:20 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-05-24 16:39:20 +0000 |
commit | 21032c421295d158d6ad09f066202bc6068189e5 (patch) | |
tree | 5517326b4751de842a1b86125cc94cc84e071d12 | |
parent | 00004d977db3db0b6e29b0b59e9d3a5913e589d3 (diff) |
Correct the ``ignoring sync/async'' warnings so that they show
up with the correct device type.
Reassign the correct tcpdevice or execdevice after transfering
a link in MP server mode.
-rw-r--r-- | usr.sbin/ppp/ppp/exec.c | 8 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/physical.c | 13 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/physical.h | 4 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/tcp.c | 8 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/tty.c | 11 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/udp.c | 20 |
6 files changed, 30 insertions, 34 deletions
diff --git a/usr.sbin/ppp/ppp/exec.c b/usr.sbin/ppp/ppp/exec.c index 296a013d613..dbd1105db9e 100644 --- a/usr.sbin/ppp/ppp/exec.c +++ b/usr.sbin/ppp/ppp/exec.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exec.c,v 1.2 1999/05/12 10:03:50 brian Exp $ + * $Id: exec.c,v 1.3 1999/05/24 16:39:19 brian Exp $ */ #include <sys/param.h> @@ -97,8 +97,10 @@ struct device * exec_iov2device(int type, struct physical *p, struct iovec *iov, int *niov, int maxiov) { - if (type == EXEC_DEVICE) + if (type == EXEC_DEVICE) { + physical_SetupStack(p, execdevice.name, PHYSICAL_FORCE_ASYNC); return &execdevice; + } return NULL; } @@ -162,7 +164,7 @@ exec_Create(struct physical *p) p->fd = fids[0]; waitpid(pid, &stat, 0); log_Printf(LogDEBUG, "Using descriptor %d for child\n", p->fd); - physical_SetupStack(p, PHYSICAL_FORCE_ASYNC); + physical_SetupStack(p, execdevice.name, PHYSICAL_FORCE_ASYNC); return &execdevice; } } diff --git a/usr.sbin/ppp/ppp/physical.c b/usr.sbin/ppp/ppp/physical.c index 08074cd8040..34b2f433cf1 100644 --- a/usr.sbin/ppp/ppp/physical.c +++ b/usr.sbin/ppp/ppp/physical.c @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: physical.c,v 1.9 1999/05/18 01:37:51 brian Exp $ + * $Id: physical.c,v 1.10 1999/05/24 16:39:19 brian Exp $ * */ @@ -571,7 +571,7 @@ iov2physical(struct datalink *dl, struct iovec *iov, int *niov, int maxiov, p->handler = (*devices[h].iov2device)(type, p, iov, niov, maxiov); if (p->handler == NULL) - physical_SetupStack(p, PHYSICAL_NOFORCE); + physical_SetupStack(p, "unknown", PHYSICAL_NOFORCE); return p; } @@ -855,7 +855,7 @@ physical_Open(struct physical *p, struct bundle *bundle) p->handler = (*devices[h].create)(p); if (p->fd >= 0) { if (p->handler == NULL) { - physical_SetupStack(p, PHYSICAL_NOFORCE); + physical_SetupStack(p, "unknown", PHYSICAL_NOFORCE); log_Printf(LogDEBUG, "%s: stdin is unidentified\n", p->link.name); } physical_Found(p); @@ -893,7 +893,7 @@ physical_Open(struct physical *p, struct bundle *bundle) } void -physical_SetupStack(struct physical *p, int how) +physical_SetupStack(struct physical *p, const char *who, int how) { link_EmptyStack(&p->link); if (how == PHYSICAL_FORCE_SYNC || @@ -912,12 +912,11 @@ physical_SetupStack(struct physical *p, int how) link_Stack(&p->link, &aliaslayer); #endif if (how == PHYSICAL_FORCE_ASYNC && physical_IsSync(p)) { - log_Printf(LogWARN, "Sync device setting ignored for ``%s'' device\n", - p->handler ? p->handler->name : "unknown"); + log_Printf(LogWARN, "Sync device setting ignored for ``%s'' device\n", who); p->cfg.speed = MODEM_SPEED; } else if (how == PHYSICAL_FORCE_SYNC && !physical_IsSync(p)) { log_Printf(LogWARN, "Async device setting ignored for ``%s'' device\n", - p->handler ? p->handler->name : "unknown"); + who); physical_SetSync(p); } } diff --git a/usr.sbin/ppp/ppp/physical.h b/usr.sbin/ppp/ppp/physical.h index d3883a1273d..ae023a3bbf1 100644 --- a/usr.sbin/ppp/ppp/physical.h +++ b/usr.sbin/ppp/ppp/physical.h @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: physical.h,v 1.8 1999/05/12 10:03:52 brian Exp $ + * $Id: physical.h,v 1.9 1999/05/24 16:39:19 brian Exp $ * */ @@ -134,5 +134,5 @@ extern int physical_RemoveFromSet(struct physical *, fd_set *, fd_set *, fd_set *); extern int physical_SetMode(struct physical *, int); extern void physical_DeleteQueue(struct physical *); -extern void physical_SetupStack(struct physical *, int); +extern void physical_SetupStack(struct physical *, const char *, int); extern void physical_StopDeviceTimer(struct physical *); diff --git a/usr.sbin/ppp/ppp/tcp.c b/usr.sbin/ppp/ppp/tcp.c index 1cfaba1a2ce..6ed9a13dc86 100644 --- a/usr.sbin/ppp/ppp/tcp.c +++ b/usr.sbin/ppp/ppp/tcp.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tcp.c,v 1.2 1999/05/12 10:03:54 brian Exp $ + * $Id: tcp.c,v 1.3 1999/05/24 16:39:19 brian Exp $ */ #include <sys/types.h> @@ -115,8 +115,10 @@ struct device * tcp_iov2device(int type, struct physical *p, struct iovec *iov, int *niov, int maxiov) { - if (type == TCP_DEVICE) + if (type == TCP_DEVICE) { + physical_SetupStack(p, tcpdevice.name, PHYSICAL_FORCE_ASYNC); return &tcpdevice; + } return NULL; } @@ -179,7 +181,7 @@ tcp_Create(struct physical *p) inet_ntoa(sock.sin_addr), ntohs(sock.sin_port)); p->name.base = p->name.full; } - physical_SetupStack(p, PHYSICAL_FORCE_ASYNC); + physical_SetupStack(p, tcpdevice.name, PHYSICAL_FORCE_ASYNC); return &tcpdevice; } } diff --git a/usr.sbin/ppp/ppp/tty.c b/usr.sbin/ppp/ppp/tty.c index 1eaa91855f9..cf992c43725 100644 --- a/usr.sbin/ppp/ppp/tty.c +++ b/usr.sbin/ppp/ppp/tty.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tty.c,v 1.6 1999/05/18 01:37:51 brian Exp $ + * $Id: tty.c,v 1.7 1999/05/24 16:39:19 brian Exp $ */ #include <sys/param.h> @@ -324,15 +324,12 @@ tty_iov2device(int type, struct physical *p, struct iovec *iov, int *niov, int maxiov) { if (type == TTY_DEVICE) { - struct ttydevice *dev; + struct ttydevice *dev = (struct ttydevice *)iov[(*niov)++].iov_base; - /* It's one of ours ! Let's create the device */ - - dev = (struct ttydevice *)iov[(*niov)++].iov_base; /* Refresh function pointers etc */ memcpy(&dev->dev, &basettydevice, sizeof dev->dev); - physical_SetupStack(p, PHYSICAL_NOFORCE); + physical_SetupStack(p, dev->dev.name, PHYSICAL_NOFORCE); if (dev->Timer.state != TIMER_STOPPED) { dev->Timer.state = TIMER_STOPPED; tty_StartTimer(p); @@ -432,7 +429,7 @@ tty_Create(struct physical *p) } else fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK); - physical_SetupStack(p, PHYSICAL_NOFORCE); + physical_SetupStack(p, dev->dev.name, PHYSICAL_NOFORCE); return &dev->dev; } diff --git a/usr.sbin/ppp/ppp/udp.c b/usr.sbin/ppp/ppp/udp.c index 24497070551..9694cb64989 100644 --- a/usr.sbin/ppp/ppp/udp.c +++ b/usr.sbin/ppp/ppp/udp.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: udp.c,v 1.1 1999/05/12 10:03:55 brian Exp $ + * $Id: udp.c,v 1.2 1999/05/24 16:39:19 brian Exp $ */ #include <sys/types.h> @@ -135,21 +135,17 @@ struct device * udp_iov2device(int type, struct physical *p, struct iovec *iov, int *niov, int maxiov) { - struct device *dev; - if (type == UDP_DEVICE) { - /* It's one of ours ! Let's create the device */ + struct udpdevice *dev = (struct udpdevice *)iov[(*niov)++].iov_base; - dev = (struct device *)iov[(*niov)++].iov_base; /* Refresh function pointers etc */ - memcpy(dev, &baseudpdevice, sizeof *dev); - /* Remember, there's really more than (sizeof *dev) there */ + memcpy(&dev->dev, &baseudpdevice, sizeof dev->dev); - physical_SetupStack(p, PHYSICAL_FORCE_SYNC); - } else - dev = NULL; + physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNC); + return &dev->dev; + } - return dev; + return NULL; } static struct udpdevice * @@ -261,7 +257,7 @@ udp_Create(struct physical *p) if (dev) { memcpy(&dev->dev, &baseudpdevice, sizeof dev->dev); - physical_SetupStack(p, PHYSICAL_FORCE_SYNC); + physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNC); return &dev->dev; } |