ippool: Port to using ppp 2.5.x

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2023-05-11 17:26:46 -07:00
parent 7552a26887
commit ec749b8100
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,60 @@
From e1b93db6a13d955c6bab6358a7fa27fecb59479f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 11 May 2023 17:24:46 -0700
Subject: [PATCH] ippool: Port to ppp 2.5 APIs
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
pppd/ippool.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pppd/ippool.c b/pppd/ippool.c
index 88cb901..d4b5c97 100644
--- a/pppd/ippool.c
+++ b/pppd/ippool.c
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include <errno.h>
#include "pppd.h"
-#include "pathnames.h"
+#include "options.h"
#include "fsm.h" /* Needed for lcp.h to include cleanly */
#include "lcp.h"
#include "ccp.h"
@@ -23,7 +23,7 @@
#include "ippool_rpc.h"
-const char pppd_version[] = VERSION;
+const char pppd_version[] = PPPD_VERSION;
static char *ippool_pool_name = NULL;
static char *ippool_pool_name2 = NULL;
@@ -205,13 +205,13 @@ void plugin_init(void)
{
#if defined(__linux__)
extern int new_style_driver; /* From sys-linux.c */
- if (!ppp_available() && !new_style_driver)
+ if (!ppp_check_kernel_support() && !new_style_driver)
fatal("Kernel doesn't support ppp_generic - "
"needed for Ippool");
#else
fatal("No IP pool support on this OS");
#endif
- add_options(ippool_options);
+ ppp_add_options(ippool_options);
memset(&ippool_addr, 0, sizeof(ippool_addr));
@@ -219,6 +219,6 @@ void plugin_init(void)
ip_down_hook = ippool_release_ip;
/* brute force, just in case ip_down_hook doesn't get called */
- add_notifier(&exitnotify, ippool_cleanup, 0);
+ ppp_add_notify(NF_EXIT, ippool_cleanup, 0);
}
--
2.40.1

View File

@ -30,6 +30,7 @@ SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-$
file://0001-pppd-ippool.c-Fix-type-casting-issues-between-in_add.patch \
file://0002-ippool_rpc_server.c-Add-missing-prototype-for-ippool.patch \
file://0001-Use-unsigned-int-type-for-1-bit-integer-bitfield.patch \
file://0001-ippool-Port-to-ppp-2.5-APIs.patch \
"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"