summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-02-23 21:46:52 +0200
committerGitHub <noreply@github.com>2026-02-23 21:46:52 +0200
commit8ea3847c1fefd8f093d69561a19684f428cba1f6 (patch)
tree013e161571a39d7d2f1b12c8af6cb161bb29d6e9
parenta5bdccf4b9b631495529227c421f9eeffd41995c (diff)
parent1314586acfc2a99c0c72cda1f517b441599719a5 (diff)
downloadaccel-ppp-show-sessions-mtu-mru.tar.gz
accel-ppp-show-sessions-mtu-mru.zip
Merge pull request #300 from marekm72/marekm72-patch-1-printf-hHEADshow-sessions-mtu-mrumaster
Simplify Alpine Linux / musl libc port
-rw-r--r--accel-pppd/CMakeLists.txt34
-rw-r--r--accel-pppd/ctrl/ipoe/arp.c6
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c8
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.h2
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe_netlink.c2
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c11
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c3
7 files changed, 13 insertions, 53 deletions
diff --git a/accel-pppd/CMakeLists.txt b/accel-pppd/CMakeLists.txt
index b274d856..49c2ff61 100644
--- a/accel-pppd/CMakeLists.txt
+++ b/accel-pppd/CMakeLists.txt
@@ -44,34 +44,6 @@ IF (RADIUS)
ADD_SUBDIRECTORY(radius)
ENDIF (RADIUS)
-# define __free_fn_t in musl
-INCLUDE (CheckCSourceCompiles)
-CHECK_C_SOURCE_COMPILES("
-#include <stdlib.h>
-#include <search.h>
-int main(void)
-{
- __free_fn_t *f;
- return 0;
-}" HAVE_FREE_FN_T)
-IF (HAVE_FREE_FN_T)
- ADD_DEFINITIONS(-DHAVE_FREE_FN_T)
-ENDIF (HAVE_FREE_FN_T)
-
-INCLUDE (CheckCSourceCompiles)
-CHECK_C_SOURCE_COMPILES("
-#include <sys/socket.h>
-#include <linux/if_arp.h>
-#include <net/ethernet.h>
-int main(void)
-{
- return 0;
-}" HAVE_GOOD_IFARP)
-
-IF (HAVE_GOOD_IFARP)
- ADD_DEFINITIONS(-DHAVE_GOOD_IFARP)
-ENDIF (HAVE_GOOD_IFARP)
-
INCLUDE (CheckCSourceCompiles)
CHECK_C_SOURCE_COMPILES("
#include <utmp.h>
@@ -104,12 +76,6 @@ ENDIF (SHAPER)
INCLUDE(CheckIncludeFile)
CHECK_INCLUDE_FILE("linux/netfilter/ipset/ip_set.h" HAVE_IPSET)
-# MUSL does not have printf.h
-CHECK_INCLUDE_FILE("printf.h" HAVE_PRINTF_H)
-IF (HAVE_PRINTF_H)
- ADD_DEFINITIONS(-DHAVE_PRINTF_H)
-ENDIF (HAVE_PRINTF_H)
-
INCLUDE(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(setns HAVE_SETNS)
diff --git a/accel-pppd/ctrl/ipoe/arp.c b/accel-pppd/ctrl/ipoe/arp.c
index ef9d3859..a6ca5b13 100644
--- a/accel-pppd/ctrl/ipoe/arp.c
+++ b/accel-pppd/ctrl/ipoe/arp.c
@@ -13,10 +13,8 @@
#include <netinet/ip.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-#ifdef HAVE_GOOD_IFARP
-#include <linux/if_arp.h>
-#endif
-#include <linux/if_packet.h>
+#include <net/if_arp.h>
+#include <netpacket/packet.h>
#include "list.h"
#include "triton.h"
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index bc55aa69..e215c565 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -14,11 +14,9 @@
#include <netinet/ip.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <linux/if.h>
-#ifdef HAVE_GOOD_IFARP
-#include <linux/if_arp.h>
-#endif
-#include <linux/route.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/route.h>
#include "events.h"
#include "list.h"
diff --git a/accel-pppd/ctrl/ipoe/ipoe.h b/accel-pppd/ctrl/ipoe/ipoe.h
index 116602be..38f521e1 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.h
+++ b/accel-pppd/ctrl/ipoe/ipoe.h
@@ -3,7 +3,7 @@
#include <stdint.h>
#include <pthread.h>
-#include <linux/if.h>
+#include <net/if.h>
#include "triton.h"
#include "ap_session.h"
diff --git a/accel-pppd/ctrl/ipoe/ipoe_netlink.c b/accel-pppd/ctrl/ipoe/ipoe_netlink.c
index e7080e92..7057c91e 100644
--- a/accel-pppd/ctrl/ipoe/ipoe_netlink.c
+++ b/accel-pppd/ctrl/ipoe/ipoe_netlink.c
@@ -10,7 +10,7 @@
#include <net/ethernet.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
-#include <linux/if.h>
+#include <net/if.h>
#include <linux/genetlink.h>
#include "triton.h"
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index d6807377..1a4c63d4 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -854,16 +854,17 @@ out_err:
return -1;
}
+static void l2tp_session_free_ptr(void *ptr)
+{
+ l2tp_session_free((struct l2tp_sess_t *) ptr);
+}
+
static void l2tp_tunnel_free_sessions(struct l2tp_conn_t *conn)
{
void *sessions = conn->sessions;
conn->sessions = NULL;
-#ifdef HAVE_FREE_FN_T
- tdestroy(sessions, (__free_fn_t)l2tp_session_free);
-#else
- tdestroy(sessions, (void(*)(void *))l2tp_session_free);
-#endif
+ tdestroy(sessions, l2tp_session_free_ptr);
/* Let l2tp_session_free() handle the session counter and
* the reference held by the tunnel.
*/
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index c481b7ec..6ec07c9d 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -11,9 +11,6 @@
#include <net/ethernet.h>
#include <netpacket/packet.h>
#include <arpa/inet.h>
-#ifdef HAVE_PRINTF_H
-#include <printf.h>
-#endif
#include "events.h"
#include "triton.h"