X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpppoe%2Fcommon.c;h=31811f59a9fbf3af05d79ff94f698ed5d7a0d321;hb=HEAD;hp=8b0e636acb800ab923a6b6c6d2cb3053448189f2;hpb=032020241d270c53dff479a7b0eb7fe487c56a78;p=ppp.git diff --git a/pppd/plugins/pppoe/common.c b/pppd/plugins/pppoe/common.c index 8b0e636..31811f5 100644 --- a/pppd/plugins/pppoe/common.c +++ b/pppd/plugins/pppoe/common.c @@ -17,17 +17,18 @@ static char const RCSID[] = "$Id: common.c,v 1.3 2008/06/09 08:34:23 paulus Exp $"; #ifdef HAVE_CONFIG_H -#include +#include "config.h" #endif #define _GNU_SOURCE 1 #include "pppoe.h" -#include "pppd/pppd.h" +#include #include #include #include #include /* for LOG_DEBUG */ +#include #ifdef HAVE_UNISTD_H #include @@ -303,6 +304,15 @@ void pppoe_printpkt(PPPoEPacket *packet, printer(arg, "unknown tag 0x%x", tag); } if (tlen) { + /* If it is supposed to be text, make sure it's all printing chars */ + if (text) { + for (j = 0; j < tlen; ++j) { + if (!isprint(packet->payload[i+j])) { + text = 0; + break; + } + } + } if (text) printer(arg, " %.*s", tlen, &packet->payload[i]); else {