]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/pppoe/plugin.c
Let ./configure control the paths for pppd
[ppp.git] / pppd / plugins / pppoe / plugin.c
index e9353eb009b4a63dabdb22a2845d5c6960090f7c..70205657202f90dd9cbe4f2b4087ca19cdb10ac8 100644 (file)
 static char const RCSID[] =
 "$Id: plugin.c,v 1.17 2008/06/15 04:35:50 paulus Exp $";
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #define _GNU_SOURCE 1
 #include "pppoe.h"
 
-#include "pppd/pppd.h"
-#include "pppd/fsm.h"
-#include "pppd/lcp.h"
-#include "pppd/ipcp.h"
-#include "pppd/ccp.h"
-/* #include "pppd/pathnames.h" */
-
 #include <linux/types.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -50,13 +48,15 @@ static char const RCSID[] =
 #include <linux/ppp_defs.h>
 #include <linux/if_pppox.h>
 
-#ifndef _ROOT_PATH
-#define _ROOT_PATH ""
-#endif
+#include <pppd/pppd.h>
+#include <pppd/fsm.h>
+#include <pppd/lcp.h>
+#include <pppd/ipcp.h>
+#include <pppd/ccp.h>
 
-#define _PATH_ETHOPT         _ROOT_PATH "/etc/ppp/options."
+#define PPP_PATH_ETHOPT         SYSCONFDIR "/ppp/options."
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 /* From sys-linux.c in pppd -- MUST FIX THIS! */
 extern int new_style_driver;
@@ -196,7 +196,7 @@ PPPOEConnectDevice(void)
 
     conn->acName = acName;
     conn->serviceName = pppd_pppoe_service;
-    strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
+    strlcpy(ppp_devnam, devnam, MAXPATHLEN);
     if (existingSession) {
        unsigned int mac[ETH_ALEN];
        int i, ses;
@@ -327,7 +327,7 @@ PPPOEDeviceOptions(void)
 {
     char buf[MAXPATHLEN];
 
-    strlcpy(buf, _PATH_ETHOPT, MAXPATHLEN);
+    strlcpy(buf, PPP_PATH_ETHOPT, MAXPATHLEN);
     strlcat(buf, devnam, MAXPATHLEN);
     if (!options_from_file(buf, 0, 0, 1))
        exit(EXIT_OPTION_ERROR);
@@ -391,7 +391,7 @@ PPPoEDevnameHook(char *cmd, char **argv, int doit)
     /* Close socket */
     close(fd);
     if (r && doit) {
-       strlcpy(devnam, cmd, sizeof(devnam));
+       strlcpy(devnam, cmd, MAXPATHLEN);
        if (the_channel != &pppoe_channel) {
 
            the_channel = &pppoe_channel;
@@ -423,7 +423,7 @@ plugin_init(void)
 
     add_options(Options);
 
-    info("PPPoE plugin from pppd %s", VERSION);
+    info("PPPoE plugin from pppd %s", PPPD_VERSION);
 }
 
 void pppoe_check_options(void)