]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/rp-pppoe/plugin.c
pppd: Use a compile test to detect crypt.h (#198)
[ppp.git] / pppd / plugins / rp-pppoe / plugin.c
index 9e838d30d58b81208b9289ff239acfb9937f03fb..93c0906119d7240fd60ba483768c3654ef642f5f 100644 (file)
@@ -46,7 +46,6 @@ static char const RCSID[] =
 #include <unistd.h>
 #include <fcntl.h>
 #include <signal.h>
-#include <net/ethernet.h>
 #include <net/if_arp.h>
 #include <linux/ppp_defs.h>
 #include <linux/if_pppox.h>
@@ -302,8 +301,10 @@ PPPOEDisconnectDevice(void)
 static void
 PPPOEDeviceOptions(void)
 {
-    char buf[256];
-    snprintf(buf, 256, _PATH_ETHOPT "%s", devnam);
+    char buf[MAXPATHLEN];
+
+    strlcpy(buf, _PATH_ETHOPT, MAXPATHLEN);
+    strlcat(buf, devnam, MAXPATHLEN);
     if (!options_from_file(buf, 0, 0, 1))
        exit(EXIT_OPTION_ERROR);