From f0f93f7f2d479e18fe43625ce59583ba7a773bf2 Mon Sep 17 00:00:00 2001 From: Nuno Antunes Date: Mon, 4 Jun 2012 05:55:16 +0100 Subject: [PATCH] usr.sbin/ppp: fix netgraph includes. If the WANT_NETGRAPH7 make variable is set, use includes from netgraph7/*; otherwise use includes from netgraph/*. It is possible to use ppp with netgraph7 for establishing pppoe connections starting from this commit. XXX: the ng_tty module has not been ported yet into netgraph7, so use the include header from legacy netgraph for now. This is an ugly hack but allows ppp to compile for now until ng_tty is ported. Reported-by: Sacha Wildner --- usr.sbin/ppp/Makefile | 4 ++++ usr.sbin/ppp/ether.c | 7 +++++++ usr.sbin/ppp/netgraph.c | 6 ++++++ usr.sbin/ppp/tty.c | 7 +++++++ 4 files changed, 24 insertions(+) diff --git a/usr.sbin/ppp/Makefile b/usr.sbin/ppp/Makefile index 2a3f29d970..5378c22be1 100644 --- a/usr.sbin/ppp/Makefile +++ b/usr.sbin/ppp/Makefile @@ -78,6 +78,10 @@ LDADD+= -lradius DPADD+= ${LIBRADIUS} .endif +.if defined(WANT_NETGRAPH7) +CFLAGS+=-DWANT_NETGRAPH7 +.endif + .if defined(NONETGRAPH) CFLAGS+=-DNONETGRAPH .else diff --git a/usr.sbin/ppp/ether.c b/usr.sbin/ppp/ether.c index e97a31dfe5..9cd237efbe 100644 --- a/usr.sbin/ppp/ether.c +++ b/usr.sbin/ppp/ether.c @@ -39,10 +39,17 @@ #include #include #include +#ifdef WANT_NETGRAPH7 +#include +#include +#include +#include +#else #include #include #include #include +#endif #include #include diff --git a/usr.sbin/ppp/netgraph.c b/usr.sbin/ppp/netgraph.c index 0b41363412..5c650eb968 100644 --- a/usr.sbin/ppp/netgraph.c +++ b/usr.sbin/ppp/netgraph.c @@ -37,9 +37,15 @@ #include #include #include +#ifdef WANT_NETGRAPH7 +#include +#include +#include +#else #include #include #include +#endif #include #include diff --git a/usr.sbin/ppp/tty.c b/usr.sbin/ppp/tty.c index 4c006bce92..0dfc4ad97b 100644 --- a/usr.sbin/ppp/tty.c +++ b/usr.sbin/ppp/tty.c @@ -45,11 +45,18 @@ #include #ifndef NONETGRAPH #include +#ifdef WANT_NETGRAPH7 +#include +#include +#include +#include /* XXX should be netgraph7/tty but that one is not ported yet */ +#else #include #include #include #include #endif +#endif #include "layer.h" #include "defs.h" -- 2.41.0