Thomas Haller 2023-06-14 16:17:59 +02:00
commit 6f9f90417e
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
7 changed files with 27 additions and 2 deletions

View file

@ -3349,6 +3349,12 @@ src_core_ppp_libnm_ppp_plugin_la_LIBADD = \
$(src_core_ppp_libnm_ppp_plugin_la_OBJECTS): $(src_libnm_core_public_mkenums_h)
check-local-ppp-plugin: src/core/NetworkManager src/core/ppp/libnm-ppp-plugin.la
$(srcdir)/tools/check-exports.sh $(builddir)/src/core/ppp/.libs/libnm-ppp-plugin.so "$(srcdir)/src/core/ppp/nm-ppp-plugin.ver"
$(call check_so_symbols,$(builddir)/src/core/ppp/.libs/libnm-ppp-plugin.so)
check_local += check-local-ppp-plugin
endif
EXTRA_DIST += \

View file

@ -239,6 +239,9 @@
/* Define to path of pppd binary */
#mesondefine PPPD_PATH
/* The detected ppp API version */
#mesondefine NM_PPP_VERSION_2_5_OR_NEWER
/* Define if you have iwd support */
#mesondefine WITH_IWD

View file

@ -754,10 +754,12 @@ fi
AC_SUBST(DBUS_SYS_DIR)
# pppd
NM_PPP_VERSION_2_5_OR_NEWER=0
PPPD_VERSION=2.4.9
PKG_CHECK_EXISTS([pppd], [
PPPD_VERSION=`$PKG_CONFIG --modversion pppd`
PPPD_CFLAGS=`$PKG_CONFIG --cflags pppd`
NM_PPP_VERSION_2_5_OR_NEWER=1
])
AC_ARG_ENABLE(ppp,
@ -783,6 +785,7 @@ else
PPPD_PLUGIN_DIR="${libdir}/pppd/$PPPD_VERSION"
fi
AC_SUBST(PPPD_PLUGIN_DIR)
AC_DEFINE_UNQUOTED(NM_PPP_VERSION_2_5_OR_NEWER, $NM_PPP_VERSION_2_5_OR_NEWER, [The detected ppp API version])
AC_ARG_WITH(pppd, AS_HELP_STRING([--with-pppd=/path/to/pppd], [path to pppd binary]))
if test "x${with_pppd}" = x; then

View file

@ -560,10 +560,12 @@ config_h.set10('WITH_FIREWALLD_ZONE', enable_firewalld_zone)
# pppd
enable_ppp = get_option('ppp')
NM_PPP_VERSION_2_5_OR_NEWER = 0
if enable_ppp
pppd_dep = dependency('pppd', required: false)
if (pppd_dep.found())
pppd_version = pppd_dep.version()
NM_PPP_VERSION_2_5_OR_NEWER = 1
else
assert(cc.has_header('pppd/pppd.h'), 'couldn\'t find pppd.h. pppd development headers are required')
pppd_version = '2.4.9'
@ -584,6 +586,7 @@ if enable_ppp
endif
endif
config_h.set10('WITH_PPP', enable_ppp)
config_h.set10('NM_PPP_VERSION_2_5_OR_NEWER', NM_PPP_VERSION_2_5_OR_NEWER)
# ModemManager1 with libmm-glib
enable_modem_manager = get_option('modem_manager')

View file

@ -843,7 +843,7 @@ create_pppd_cmd_line(NMPPPManager *self,
const char *pppoe_service;
nm_strv_ptrarray_add_string_dup(cmd, "plugin");
nm_strv_ptrarray_add_string_dup(cmd, "rp-pppoe.so");
nm_strv_ptrarray_add_string_dup(cmd, NM_PPPOE_PLUGIN_NAME);
nm_strv_ptrarray_add_string_concat(cmd, "nic-", priv->parent_iface);
@ -872,7 +872,7 @@ create_pppd_cmd_line(NMPPPManager *self,
} else if (!strcmp(protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)) {
nm_strv_ptrarray_add_string_dup(cmd, "plugin");
nm_strv_ptrarray_add_string_dup(cmd, "rp-pppoe.so");
nm_strv_ptrarray_add_string_dup(cmd, NM_PPPOE_PLUGIN_NAME);
nm_strv_ptrarray_add_string_dup(cmd, priv->parent_iface);
}

View file

@ -29,4 +29,10 @@ typedef enum {
NM_PPP_STATUS_INTERN_DEAD,
} NMPPPStatus;
/*****************************************************************************/
/* The plugin name "(rp-)pppoe.so" depends on the ppp version. */
#define NM_PPPOE_PLUGIN_NAME (NM_PPP_VERSION_2_5_OR_NEWER ? "pppoe.so" : "rp-pppoe.so")
#endif /* __NM_PPP_STATUS_H__ */

View file

@ -75,6 +75,10 @@ _NM_PRAGMA_WARNING_REENABLE;
/*****************************************************************************/
G_STATIC_ASSERT(PPP_VERSION_2_5_OR_NEWER == NM_PPP_VERSION_2_5_OR_NEWER);
/*****************************************************************************/
G_STATIC_ASSERT((gint64) NM_PPP_STATUS_DEAD == PHASE_DEAD);
G_STATIC_ASSERT((gint64) NM_PPP_STATUS_INITIALIZE == PHASE_INITIALIZE);
G_STATIC_ASSERT((gint64) NM_PPP_STATUS_SERIALCONN == PHASE_SERIALCONN);