From b7b97dea6eb042fae0dfaca39cbb190411e5fd31 Mon Sep 17 00:00:00 2001 From: Stefan Nickl Date: Wed, 10 Aug 2016 16:52:12 +0200 Subject: [PATCH] pppd: Provide error() implementation in pppoe-discovery The pppoe-discovery program calls error() from the CHECK_ROOM macro defined in pppoe.h. Since pppoe-discovery is a standalone program not linked with the rest of pppd, the only way this could build is by linking to glibc's proprietary error(3) function instead of the function of the same name (but with different arguments) defined in pppd/utils.c. So with glibc this builds, but will probably crash when the assertion is triggered. As the assertion is unlikely to fail, nobody has noticed. The build however fails with musl libc or uClibc since they don't provide the doppelganger. Signed-off-by: Stefan Nickl --- pppd/plugins/rp-pppoe/pppoe-discovery.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c index 3d3bf4e..55037df 100644 --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c @@ -9,6 +9,7 @@ * */ +#include #include #include #include @@ -55,6 +56,14 @@ void die(int status) exit(status); } +void error(char *fmt, ...) +{ + va_list pvar; + va_start(pvar, fmt); + vfprintf(stderr, fmt, pvar); + va_end(pvar); +} + /* Initialize frame types to RFC 2516 values. Some broken peers apparently use different frame types... sigh... */ -- 2.39.2