diff --git a/src/add-ons/kernel/network/ppp/shared/libppp/Jamfile b/src/add-ons/kernel/network/ppp/shared/libppp/Jamfile index 2d0ba590ef..2e230f62bb 100644 --- a/src/add-ons/kernel/network/ppp/shared/libppp/Jamfile +++ b/src/add-ons/kernel/network/ppp/shared/libppp/Jamfile @@ -11,6 +11,7 @@ UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkerne StaticLibrary ppp : settings_tools.cpp + _libppputils.cpp PPPInterface.cpp PPPManager.cpp ; diff --git a/src/add-ons/kernel/network/ppp/shared/libppp/PPPInterface.cpp b/src/add-ons/kernel/network/ppp/shared/libppp/PPPInterface.cpp index 56cb27d996..c8a85a1d1f 100644 --- a/src/add-ons/kernel/network/ppp/shared/libppp/PPPInterface.cpp +++ b/src/add-ons/kernel/network/ppp/shared/libppp/PPPInterface.cpp @@ -8,12 +8,12 @@ #include "PPPInterface.h" #include -#include +#include "_libppputils.h" PPPInterface::PPPInterface(interface_id ID = PPP_UNDEFINED_INTERFACE_ID) { - fFD = open("/dev/net/stack", O_RDWR); + fFD = open(get_stack_driver_path(), O_RDWR); SetTo(ID); } @@ -21,7 +21,7 @@ PPPInterface::PPPInterface(interface_id ID = PPP_UNDEFINED_INTERFACE_ID) PPPInterface::PPPInterface(const PPPInterface& copy) { - fFD = open("/dev/net/stack", O_RDWR); + fFD = open(get_stack_driver_path(), O_RDWR); SetTo(copy.ID()); } diff --git a/src/add-ons/kernel/network/ppp/shared/libppp/PPPManager.cpp b/src/add-ons/kernel/network/ppp/shared/libppp/PPPManager.cpp index e3fd48327e..f6ba7e7952 100644 --- a/src/add-ons/kernel/network/ppp/shared/libppp/PPPManager.cpp +++ b/src/add-ons/kernel/network/ppp/shared/libppp/PPPManager.cpp @@ -8,14 +8,14 @@ #include "PPPManager.h" #include "PPPInterface.h" -#include #include #include +#include "_libppputils.h" PPPManager::PPPManager() { - fFD = open("/dev/net/stack", O_RDWR); + fFD = open(get_stack_driver_path(), O_RDWR); } diff --git a/src/add-ons/kernel/network/ppp/shared/libppp/_libppputils.cpp b/src/add-ons/kernel/network/ppp/shared/libppp/_libppputils.cpp new file mode 100644 index 0000000000..892975e46f --- /dev/null +++ b/src/add-ons/kernel/network/ppp/shared/libppp/_libppputils.cpp @@ -0,0 +1,23 @@ +//---------------------------------------------------------------------- +// This software is part of the OpenBeOS distribution and is covered +// by the OpenBeOS license. +//--------------------------------------------------------------------- + +#include +#include "_libppputils.h" +#include + + +char* +get_stack_driver_path() +{ + char *path; + + // user-defined stack driver path? + path = getenv("NET_STACK_DRIVER_PATH"); + if(path) + return path; + + // use the default stack driver path + return NET_STACK_DRIVER_PATH; +} diff --git a/src/add-ons/kernel/network/ppp/shared/libppp/_libppputils.h b/src/add-ons/kernel/network/ppp/shared/libppp/_libppputils.h new file mode 100644 index 0000000000..5fb2192835 --- /dev/null +++ b/src/add-ons/kernel/network/ppp/shared/libppp/_libppputils.h @@ -0,0 +1,15 @@ +//---------------------------------------------------------------------- +// This software is part of the OpenBeOS distribution and is covered +// by the OpenBeOS license. +//--------------------------------------------------------------------- + +#ifndef __libppputils__h +#define __libppputils__h + +#include + + +char *get_stack_driver_path(); + + +#endif