wok-current diff ppp-pam/stuff/ppp-glibc.patch @ rev 25642

Bump linux to 4.19.305, add linux-pae-ipv6
author Stanislas Leduc <shann@slitaz.org>
date Wed Jan 17 12:05:22 2024 +0000 (12 months ago)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ppp-pam/stuff/ppp-glibc.patch	Wed Jan 17 12:05:22 2024 +0000
     1.3 @@ -0,0 +1,60 @@
     1.4 +From 98ec18f098e5ef68e3a8cc6954fcaf5a7fb8b7be Mon Sep 17 00:00:00 2001
     1.5 +From: pali <7141871+pali@users.noreply.github.com>
     1.6 +Date: Mon, 15 Feb 2021 07:54:01 +0100
     1.7 +Subject: [PATCH] pppd: Fix compilation with older glibc or kernel headers
     1.8 + (#248)
     1.9 +MIME-Version: 1.0
    1.10 +Content-Type: text/plain; charset=UTF-8
    1.11 +Content-Transfer-Encoding: 8bit
    1.12 +
    1.13 +glibc versions prior to 2.24 do not define SOL_NETLINK and linux kernel
    1.14 +versions prior to 4.3 do not define NETLINK_CAP_ACK. So add fallback
    1.15 +definitions for these macros into pppd/sys-linux.c file.
    1.16 +
    1.17 +Also extend description why we call SOL_NETLINK/NETLINK_CAP_ACK option.
    1.18 +
    1.19 +Signed-off-by: Pali Rohár <pali@kernel.org>
    1.20 +
    1.21 +[Retrieved from:
    1.22 +https://github.com/ppp-project/ppp/commit/98ec18f098e5ef68e3a8cc6954fcaf5a7fb8b7be]
    1.23 +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
    1.24 +---
    1.25 + pppd/sys-linux.c | 18 +++++++++++++++++-
    1.26 + 1 file changed, 17 insertions(+), 1 deletion(-)
    1.27 +
    1.28 +diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
    1.29 +index 85033d97..50c4f2da 100644
    1.30 +--- a/pppd/sys-linux.c
    1.31 ++++ b/pppd/sys-linux.c
    1.32 +@@ -125,6 +125,14 @@
    1.33 + #include <linux/netlink.h>
    1.34 + #include <linux/rtnetlink.h>
    1.35 + #include <linux/if_addr.h>
    1.36 ++/* glibc versions prior to 2.24 do not define SOL_NETLINK */
    1.37 ++#ifndef SOL_NETLINK
    1.38 ++#define SOL_NETLINK 270
    1.39 ++#endif
    1.40 ++/* linux kernel versions prior to 4.3 do not define/support NETLINK_CAP_ACK */
    1.41 ++#ifndef NETLINK_CAP_ACK
    1.42 ++#define NETLINK_CAP_ACK 10
    1.43 ++#endif
    1.44 + #endif
    1.45 + 
    1.46 + #include "pppd.h"
    1.47 +@@ -2843,7 +2851,15 @@ static int append_peer_ipv6_address(unsigned int iface, struct in6_addr *local_a
    1.48 +     if (fd < 0)
    1.49 +         return 0;
    1.50 + 
    1.51 +-    /* do not ask for error message content */
    1.52 ++    /*
    1.53 ++     * Tell kernel to not send to us payload of acknowledgment error message.
    1.54 ++     * NETLINK_CAP_ACK option is supported since Linux kernel version 4.3 and
    1.55 ++     * older kernel versions always send full payload in acknowledgment netlink
    1.56 ++     * message. We ignore payload of this message as we need only error code,
    1.57 ++     * to check if our set remote peer address request succeeded or failed.
    1.58 ++     * So ignore return value from the following setsockopt() call as setting
    1.59 ++     * option NETLINK_CAP_ACK means for us just a kernel hint / optimization.
    1.60 ++     */
    1.61 +     one = 1;
    1.62 +     setsockopt(fd, SOL_NETLINK, NETLINK_CAP_ACK, &one, sizeof(one));
    1.63 +