diff options
author | brian <brian@FreeBSD.org> | 1999-11-06 22:50:59 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-11-06 22:50:59 +0000 |
commit | cac81ba45e2e673e229f5ea7773bab9d5a35b735 (patch) | |
tree | 05464cda97fbc141305fb350e1211787d0b945dc /usr.sbin/ppp/tcp.c | |
parent | 5e8870e5439ac382bd1d3732b119bf5cf81405b6 (diff) | |
download | FreeBSD-src-cac81ba45e2e673e229f5ea7773bab9d5a35b735.zip FreeBSD-src-cac81ba45e2e673e229f5ea7773bab9d5a35b735.tar.gz |
Support PPPoE
Help (lots) from: julian, archie
Facilities from: ahebert@pubnix.net
Diffstat (limited to 'usr.sbin/ppp/tcp.c')
-rw-r--r-- | usr.sbin/ppp/tcp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/ppp/tcp.c b/usr.sbin/ppp/tcp.c index 7fd53a7..c6cb16d 100644 --- a/usr.sbin/ppp/tcp.c +++ b/usr.sbin/ppp/tcp.c @@ -109,12 +109,13 @@ static struct device tcpdevice = { NULL, NULL, NULL, + NULL, NULL }; struct device * tcp_iov2device(int type, struct physical *p, struct iovec *iov, - int *niov, int maxiov) + int *niov, int maxiov, int *auxfd, int *nauxfd) { if (type == TCP_DEVICE) { free(iov[(*niov)++].iov_base); @@ -131,7 +132,7 @@ tcp_Create(struct physical *p) char *cp, *host, *port, *svc; if (p->fd < 0) { - if ((cp = strchr(p->name.full, ':')) != NULL) { + if ((cp = strchr(p->name.full, ':')) != NULL && !strchr(cp + 1, ':')) { *cp = '\0'; host = p->name.full; port = cp + 1; @@ -140,8 +141,10 @@ tcp_Create(struct physical *p) *cp = ':'; return 0; } - if (svc) + if (svc) { + p->fd--; /* We own the device but maybe can't use it - change fd */ *svc = '\0'; + } if (*host && *port) { p->fd = tcp_OpenConnection(p->link.name, host, port); *cp = ':'; |