diff options
author | brian <brian@FreeBSD.org> | 2002-03-30 12:30:09 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2002-03-30 12:30:09 +0000 |
commit | ee9763124d8cbeceba9f2194f3ea61c1f2c1d362 (patch) | |
tree | b285f7b912098d74c02bd2a8b542e1472a52003a /usr.sbin/ppp/ether.c | |
parent | ef538de24ea069ff6846f7363f8a329a92cf1aa1 (diff) | |
download | FreeBSD-src-ee9763124d8cbeceba9f2194f3ea61c1f2c1d362.zip FreeBSD-src-ee9763124d8cbeceba9f2194f3ea61c1f2c1d362.tar.gz |
Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's line
discipline to do the async escaping, but no other benefits are available yet.
Change ``ifdef HAVE_DES'' to ``ifndef NODES'' for consistency.
Make the Makefile a little more sane WRT RELEASE_CRUNCH.
Diffstat (limited to 'usr.sbin/ppp/ether.c')
-rw-r--r-- | usr.sbin/ppp/ether.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/usr.sbin/ppp/ether.c b/usr.sbin/ppp/ether.c index f8a3534..3f65f1c 100644 --- a/usr.sbin/ppp/ether.c +++ b/usr.sbin/ppp/ether.c @@ -49,10 +49,6 @@ #include <string.h> #include <sysexits.h> #include <sys/fcntl.h> -#if defined(__FreeBSD__) && !defined(NOKLDLOAD) -#include <sys/linker.h> -#include <sys/module.h> -#endif #include <sys/stat.h> #include <sys/uio.h> #include <termios.h> @@ -302,6 +298,7 @@ static const struct device baseetherdevice = { NULL, NULL, NULL, + NULL, ether_Free, ether_Read, ether_Write, @@ -432,29 +429,8 @@ ether_Create(struct physical *p) p->fd--; /* We own the device - change fd */ -#if defined(__FreeBSD__) && !defined(NOKLDLOAD) - if (modfind("netgraph") == -1 && ID0kldload("netgraph") == -1) { - log_Printf(LogWARN, "kldload: netgraph: %s\n", strerror(errno)); - return NULL; - } - - if (modfind("ng_ether") == -1 && ID0kldload("ng_ether") == -1) - /* - * Don't treat this as an error as older kernels have this stuff - * built in as part of the netgraph node itself. - */ - log_Printf(LogWARN, "kldload: ng_ether: %s\n", strerror(errno)); - - if (modfind("ng_pppoe") == -1 && ID0kldload("ng_pppoe") == -1) { - log_Printf(LogWARN, "kldload: ng_pppoe: %s\n", strerror(errno)); - return NULL; - } - - if (modfind("ng_socket") == -1 && ID0kldload("ng_socket") == -1) { - log_Printf(LogWARN, "kldload: ng_socket: %s\n", strerror(errno)); - return NULL; - } -#endif + loadmodules(LOAD_VERBOSLY, "netgraph", "ng_ether", "ng_pppoe", "ng_socket", + NULL); if ((dev = malloc(sizeof *dev)) == NULL) return NULL; @@ -498,6 +474,7 @@ ether_Create(struct physical *p) log_Printf(LogWARN, "Cannot create netgraph socket node: %s\n", strerror(errno)); free(dev); + p->fd = -2; return NULL; } @@ -565,7 +542,7 @@ ether_Create(struct physical *p) if (f == ninfo->hooks) { /* * Create a new ``PPPoE'' node connected to the ``ether'' node using - * the magic ``orphan'' and ``ethernet'' hooks + * the ``orphan'' and ``ethernet'' hooks */ snprintf(mkp.type, sizeof mkp.type, "%s", NG_PPPOE_NODE_TYPE); snprintf(mkp.ourhook, sizeof mkp.ourhook, "%s", NG_ETHER_HOOK_ORPHAN); |