diff options
author | Mike Gilbert <floppym@gentoo.org> | 2023-04-14 13:04:34 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2023-04-14 13:07:50 -0400 |
commit | 831f1a3cac976e569e457d0b41c2f530e91b342b (patch) | |
tree | 86ccb0a922dd3ddc3ba797380d9138b864f87902 /net-dialup | |
parent | net-p2p/transmission: drop 4.0.1-r2 (diff) | |
download | gentoo-831f1a3cac976e569e457d0b41c2f530e91b342b.tar.gz gentoo-831f1a3cac976e569e457d0b41c2f530e91b342b.tar.bz2 gentoo-831f1a3cac976e569e457d0b41c2f530e91b342b.zip |
net-dialup/ppp: move dhcp patches to FILESDIR
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'net-dialup')
5 files changed, 311 insertions, 6 deletions
diff --git a/net-dialup/ppp/Manifest b/net-dialup/ppp/Manifest index bb3a3fd78f67..4582f760fc8f 100644 --- a/net-dialup/ppp/Manifest +++ b/net-dialup/ppp/Manifest @@ -1,6 +1,5 @@ DIST ppp-2.4.9-patches-03.tar.xz 18520 BLAKE2B b3da095672fa57727ba11a5dba761ea3f24ee330f27252f0379dab5761d5381809176faafed86d97a6b89cc8a4cb958baa07f4900e22fe6e76b6c852e0703f0c SHA512 9a035acf1915225340c12e6242f0c5db399b5f5970888d7f1799a5f125cf97b95d9fcb8c9aa2f6bd56c1544d2b10585f772d4fc1025002e3e8403011e3d2c029 DIST ppp-2.4.9.tar.gz 719904 BLAKE2B 7ba3eb8c98fec5599635dbd302399617e1075f3a1df090f1a94ce2bb8a5c7631e6eea82246adc33711aba5fe95e7ba7c982e2cbf1fb0d71e45f877d9b092ffb7 SHA512 c309f8f69f534c05547cd2f66dade0e0f198ea4c2928a7e899e660280786b3e965437a67b8c5bb81c59d0fa1818b4eb7b701d2dce015a420d380422d2bca4e1a -DIST ppp-2.5.0-dhcp-patches.tar.gz 3653 BLAKE2B 61c8d57a24ea09c03b7db26aec7ec14b31fb4f3829a01e2cf6430e6734a499def490879ea9168e5a1619eb274489ca868b09fe81f16ccdc27a0bbb18a4b00849 SHA512 96030473d1dc541a0abd63ca683eea728c1fe3811d8a2cb3fccef2b0c6fc02c10e1c01b49a05ac66222bf7477c431eeb89d8a6f6223efd3c2ae00bc4524abdf2 DIST ppp-2.5.0.tar.gz 1170057 BLAKE2B 6a0e9efcbff3cb499705071cc7d0e3411cf4871fd53b2bfedbb1f2cf3ad80728eb436050cf33b78e36d473be64f15907a21da17f283337455f0af379bc18272d SHA512 094368ea2aa6c6e8dfba4443509857a7c1c7ff839bb6d6657743802477208c01e87db31593cef0932d3725c640e9c103179da6b742825034cda82bd31ddcc2ed DIST ppp-dhcpc.tgz 33497 BLAKE2B ca59130012f007cf45af6bcfa468c112b0d521c8b11f42d42c566dd9de55bd6d6f1b1ceb83cbae18cfe79cb5cb36ba6c6858a4718915acc6987295008aca53da SHA512 aeaf791b14f5a09c0e2079072a157e65132cbff46e608bc0724e6a5827a01da934f5006e2774eb7105f83e607a52cb4987238f4385cf6f5cc86cbe305a556738 DIST pppgetpass.8 154398 BLAKE2B 0e74b96df6171b7382874ce08375d0122df2b564ce8c3e8081022c38ef433e22d15ad13a51d553c6e18ee6277d9c67302b50afa59126bf74a6e3dcd1b03a2b2b SHA512 aca33e489d3e78a7accced4d3c33c03d933cf4c0b6607e8a6bbefef202c853248fa85caa36b53b9cbaf8b21ae60bb00fb3f95577418112630dfa6d67ad700359 diff --git a/net-dialup/ppp/files/ppp-2.5.0-dhcp/0001-Convert-sys_errlist-to-strerror.patch b/net-dialup/ppp/files/ppp-2.5.0-dhcp/0001-Convert-sys_errlist-to-strerror.patch new file mode 100644 index 000000000000..193e90b78a9a --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-dhcp/0001-Convert-sys_errlist-to-strerror.patch @@ -0,0 +1,148 @@ +From e21d256cded13a625bc28d3fe812141a202be696 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Thu, 13 Apr 2023 14:59:35 -0400 +Subject: [PATCH 1/3] Convert sys_errlist to strerror + +--- + dhcpc.c | 8 ++++---- + packet.c | 6 +++--- + socket.c | 14 +++++++------- + 3 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/dhcpc.c b/dhcpc.c +index fcff8b9..ff83b53 100644 +--- a/dhcpc.c ++++ b/dhcpc.c +@@ -144,7 +144,7 @@ void change_mode(int new_mode) + fd = raw_socket(client_config.ifindex); + + if (listen_mode != LISTEN_NONE && fd < 0) { +- fatal("DHCPC: couldn't listen on socket, %s", sys_errlist[errno]); ++ fatal("DHCPC: couldn't listen on socket, %s", strerror(errno)); + } + + } +@@ -208,7 +208,7 @@ void dhcp_rx(void *dummy) { + len = get_packet(&packet, fd); + + if (len == -1 && errno != EINTR) { +- dbglog("DHCPC: error on read, %s, reopening socket", sys_errlist[errno]); ++ dbglog("DHCPC: error on read, %s, reopening socket", strerror(errno)); + change_mode(LISTEN_KERNEL); + } + if (len < 0) continue; +@@ -380,7 +380,7 @@ void dhcp_request_new() { + else len = get_raw_packet(&packet, fd); + + if (len == -1 && errno != EINTR) { +- dbglog("DHCPC: error on read, %s, reopening socket", sys_errlist[errno]); ++ dbglog("DHCPC: error on read, %s, reopening socket", strerror(errno)); + change_mode(listen_mode); /* just close and reopen */ + } + if (len < 0) continue; +@@ -445,7 +445,7 @@ void dhcp_request_new() { + + } else { + /* An error occured */ +- dbglog("DHCPC: error on select, %s, reopening socket", sys_errlist[errno]); ++ dbglog("DHCPC: error on select, %s, reopening socket", strerror(errno)); + change_mode(listen_mode); /* just close and reopen */ + } + +diff --git a/packet.c b/packet.c +index 00b5202..07a1aac 100644 +--- a/packet.c ++++ b/packet.c +@@ -125,7 +125,7 @@ int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port + return kernel_packet(payload,payload->giaddr,CLIENT_PORT,dest_ip,dest_port); + + if ((fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) { +- DEBUG(LOG_ERR, "socket call failed: %s", sys_errlist[errno]); ++ DEBUG(LOG_ERR, "socket call failed: %s", strerror(errno)); + return -1; + } + +@@ -138,7 +138,7 @@ int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port + dest.sll_halen = 6; + memcpy(dest.sll_addr, dest_arp, 6); + if (bind(fd, (struct sockaddr *)&dest, sizeof(struct sockaddr_ll)) < 0) { +- DEBUG(LOG_ERR, "bind call failed: %s", sys_errlist[errno]); ++ DEBUG(LOG_ERR, "bind call failed: %s", strerror(errno)); + close(fd); + return -1; + } +@@ -161,7 +161,7 @@ int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port + + result = sendto(fd, &packet, sizeof(struct udp_dhcp_packet), 0, (struct sockaddr *) &dest, sizeof(dest)); + if (result <= 0) { +- DEBUG(LOG_ERR, "write on socket failed: %s", sys_errlist[errno]); ++ DEBUG(LOG_ERR, "write on socket failed: %s", strerror(errno)); + } + close(fd); + return result; +diff --git a/socket.c b/socket.c +index 0234350..a6799d5 100644 +--- a/socket.c ++++ b/socket.c +@@ -60,7 +60,7 @@ int read_interface(char *interface, int *ifindex, u_int32_t *addr, unsigned char + *addr = sin->sin_addr.s_addr; + DEBUG(LOG_INFO, "%s (our ip) = %s", ifr.ifr_name, inet_ntoa(sin->sin_addr)); + } else { +- LOG(LOG_ERR, "SIOCGIFADDR failed!: %s", sys_errlist[errno]); ++ LOG(LOG_ERR, "SIOCGIFADDR failed!: %s", strerror(errno)); + return -1; + } + } +@@ -69,7 +69,7 @@ int read_interface(char *interface, int *ifindex, u_int32_t *addr, unsigned char + DEBUG(LOG_INFO, "adapter index %d", ifr.ifr_ifindex); + *ifindex = ifr.ifr_ifindex; + } else { +- LOG(LOG_ERR, "SIOCGIFINDEX failed!: %s", sys_errlist[errno]); ++ LOG(LOG_ERR, "SIOCGIFINDEX failed!: %s", strerror(errno)); + return -1; + } + if (ioctl(fd, SIOCGIFHWADDR, &ifr) == 0) { +@@ -77,11 +77,11 @@ int read_interface(char *interface, int *ifindex, u_int32_t *addr, unsigned char + DEBUG(LOG_INFO, "adapter hardware address %02x:%02x:%02x:%02x:%02x:%02x", + arp[0], arp[1], arp[2], arp[3], arp[4], arp[5]); + } else { +- LOG(LOG_ERR, "SIOCGIFHWADDR failed!: %s", sys_errlist[errno]); ++ LOG(LOG_ERR, "SIOCGIFHWADDR failed!: %s", strerror(errno)); + return -1; + } + } else { +- LOG(LOG_ERR, "socket failed!: %s", sys_errlist[errno]); ++ LOG(LOG_ERR, "socket failed!: %s", strerror(errno)); + return -1; + } + close(fd); +@@ -98,7 +98,7 @@ int listen_socket(unsigned int ip, int port, char *inf) + + DEBUG(LOG_INFO, "Opening listen socket on 0x%08x:%d %s\n", ip, port, inf ? inf : "*"); + if ((fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { +- DEBUG(LOG_ERR, "socket call failed: %s", sys_errlist[errno]); ++ DEBUG(LOG_ERR, "socket call failed: %s", strerror(errno)); + return -1; + } + +@@ -144,7 +144,7 @@ int raw_socket(int ifindex) + + DEBUG(LOG_INFO, "Opening raw socket on ifindex %d\n", ifindex); + if ((fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) { +- DEBUG(LOG_ERR, "socket call failed: %s", sys_errlist[errno]); ++ DEBUG(LOG_ERR, "socket call failed: %s", strerror(errno)); + return -1; + } + +@@ -152,7 +152,7 @@ int raw_socket(int ifindex) + sock.sll_protocol = htons(ETH_P_IP); + sock.sll_ifindex = ifindex; + if (bind(fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) { +- DEBUG(LOG_ERR, "bind call failed: %s", sys_errlist[errno]); ++ DEBUG(LOG_ERR, "bind call failed: %s", strerror(errno)); + close(fd); + return -1; + } +-- +2.40.0 + diff --git a/net-dialup/ppp/files/ppp-2.5.0-dhcp/0002-Add-Makefile.am.patch b/net-dialup/ppp/files/ppp-2.5.0-dhcp/0002-Add-Makefile.am.patch new file mode 100644 index 000000000000..5009c4eb3469 --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-dhcp/0002-Add-Makefile.am.patch @@ -0,0 +1,35 @@ +From 9fa2696fa7348e647289e08ce299bb27ab97356d Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Thu, 13 Apr 2023 15:20:30 -0400 +Subject: [PATCH 2/3] Add Makefile.am + +--- + Makefile | 1 - + Makefile.am | 6 ++++++ + 2 files changed, 6 insertions(+), 1 deletion(-) + delete mode 120000 Makefile + create mode 100644 Makefile.am + +diff --git a/Makefile b/Makefile +deleted file mode 120000 +index 8bad27d..0000000 +--- a/Makefile ++++ /dev/null +@@ -1 +0,0 @@ +-Makefile.linux +\ No newline at end of file +diff --git a/Makefile.am b/Makefile.am +new file mode 100644 +index 0000000..195435a +--- /dev/null ++++ b/Makefile.am +@@ -0,0 +1,6 @@ ++pppd_plugin_LTLIBRARIES = dhcpc.la ++pppd_plugindir = $(PPPD_PLUGIN_DIR) ++ ++dhcpc_la_CPPFLAGS = -I${top_srcdir} ++dhcpc_la_LDFLAGS = -module -avoid-version ++dhcpc_la_SOURCES = dhcpc.c clientpacket.c options.c packet.c socket.c +-- +2.40.0 + diff --git a/net-dialup/ppp/files/ppp-2.5.0-dhcp/0003-Fix-build-with-ppp-2.5.0.patch b/net-dialup/ppp/files/ppp-2.5.0-dhcp/0003-Fix-build-with-ppp-2.5.0.patch new file mode 100644 index 000000000000..9d3585dbb6ac --- /dev/null +++ b/net-dialup/ppp/files/ppp-2.5.0-dhcp/0003-Fix-build-with-ppp-2.5.0.patch @@ -0,0 +1,126 @@ +From f3707ff09fb17e6d6b851f6cda66e2bdfa4b9108 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Thu, 13 Apr 2023 16:09:45 -0400 +Subject: [PATCH 3/3] Fix build with ppp-2.5.0 + +--- + debug.h | 1 + + dhcpc.c | 26 +++++++++++++++----------- + 2 files changed, 16 insertions(+), 11 deletions(-) + +diff --git a/debug.h b/debug.h +index e01bd0b..674dffb 100644 +--- a/debug.h ++++ b/debug.h +@@ -2,6 +2,7 @@ + #define _DEBUG_H + + #include <stdio.h> ++#include <pppd/pppd.h> + + #define DEBUG + #ifdef DEBUG +diff --git a/dhcpc.c b/dhcpc.c +index ff83b53..d383793 100644 +--- a/dhcpc.c ++++ b/dhcpc.c +@@ -33,7 +33,6 @@ + #include <sys/types.h> + #include <sys/file.h> + #include <unistd.h> +-#include <getopt.h> + #include <stdlib.h> + #include <sys/socket.h> + #include <netinet/in.h> +@@ -44,9 +43,12 @@ + #include <net/if.h> + #include <errno.h> + +-#include "pppd.h" ++#include <pppd/pppd.h> ++#include <pppd/options.h> ++#include <pppd/fsm.h> ++#include <pppd/ipcp.h> + +-char pppd_version[] = VERSION; ++char pppd_version[] = PPPD_VERSION; + + #include "dhcpd.h" + #include "dhcpc.h" +@@ -237,8 +239,8 @@ void dhcp_rx(void *dummy) { + if (requested_ip != assigned_ip) { + fatal("DHCPC: Terminating because address has changed!"); + } +- untimeout(&dhcp_renew,NULL); +- timeout(&dhcp_renew, NULL, lease / 2,0); ++ ppp_untimeout(&dhcp_renew,NULL); ++ ppp_timeout(&dhcp_renew, NULL, lease / 2,0); + return; + } else if (*message == DHCPNAK) { + /* return to init state */ +@@ -248,7 +250,7 @@ void dhcp_rx(void *dummy) { + } + } + } +- timeout(&dhcp_rx,NULL,DHCP_RX_POLL_INTERVAL,0); ++ ppp_timeout(&dhcp_rx,NULL,DHCP_RX_POLL_INTERVAL,0); + + } + +@@ -272,7 +274,7 @@ void dhcp_renew(void *dummy) { + if (dhcp_state == BOUND) { + dhcp_state = RENEWING; + change_mode(LISTEN_KERNEL); +- timeout(&dhcp_rx,NULL,3,0); ++ ppp_timeout(&dhcp_rx,NULL,3,0); + dbglog("DHCPC: Entering renew state"); + /* 1/2 of lease used on entry, timeout renew after another 3/8 of lease */ + dhcp_renew_timeout = (lease * 0x3) >> 3; +@@ -299,7 +301,7 @@ void dhcp_renew(void *dummy) { + send_renew(xid, dhcp_state==REBINDING ? client_config.siaddr : server_addr, requested_ip); + + dhcp_renew_timeout-=dhcp_packet_interval; +- timeout(&dhcp_renew, NULL, dhcp_packet_interval,0); ++ ppp_timeout(&dhcp_renew, NULL, dhcp_packet_interval,0); + } + + void dhcp_request_new() { +@@ -312,6 +314,7 @@ void dhcp_request_new() { + int c, len; + struct dhcpMessage packet; + time_t now; ++ const char *peer_authname = ppp_peer_authname(NULL, 0); + + if (dhcp_state == BOUND || dhcp_state == RENEWING || dhcp_state == REBINDING) + return; +@@ -426,7 +429,7 @@ void dhcp_request_new() { + dhcp_process_ack(&packet); + assigned_ip = requested_ip; + dbglog("DHCPC: Setting renewal timer for %d seconds", lease /2); +- timeout(&dhcp_renew, NULL, lease / 2,0); ++ ppp_timeout(&dhcp_renew, NULL, lease / 2,0); + return; + } else if (*message == DHCPNAK) { + /* return to init state */ +@@ -455,6 +458,7 @@ void dhcp_request_new() { + + void dhcp_ip_choose(u_int32_t *addrp) { + u_int32_t entryvalue; ++ const char *peer_authname = ppp_peer_authname(NULL, 0); + + dbglog("DHCPC: ip_choose_hook entered with peer name %s",peer_authname); + +@@ -489,8 +493,8 @@ void plugin_init(void) + /* we save pointer to ip_choose_hook so we can defer to other modules + that may specify an IP, e.g. radius */ + ip_choose_hook= dhcp_ip_choose; +- add_options(dhcpc_options); +- add_notifier(&exitnotify, dhcp_release, NULL); ++ ppp_add_options(dhcpc_options); ++ ppp_add_notify(NF_EXIT, dhcp_release, NULL); + info("DHCPC: plugin initialized"); + + } +-- +2.40.0 + diff --git a/net-dialup/ppp/ppp-2.5.0.ebuild b/net-dialup/ppp/ppp-2.5.0.ebuild index 58672da24450..1994d63f1948 100644 --- a/net-dialup/ppp/ppp-2.5.0.ebuild +++ b/net-dialup/ppp/ppp-2.5.0.ebuild @@ -11,10 +11,7 @@ DESCRIPTION="Point-to-Point Protocol (PPP)" HOMEPAGE="https://ppp.samba.org/" SRC_URI="https://download.samba.org/pub/ppp/${P}.tar.gz https://github.com/ppp-project/ppp/blob/${P}/contrib/pppgetpass/pppgetpass.8 - dhcp? ( - http://www.netservers.net.uk/gpl/ppp-dhcpc.tgz - https://dev.gentoo.org/~floppym/dist/${P}-dhcp-patches.tar.gz - )" + dhcp? ( http://www.netservers.net.uk/gpl/ppp-dhcpc.tgz )" #https://dev.gentoo.org/~polynomial-c/${PATCH_TARBALL_NAME}.tar.xz LICENSE="BSD GPL-2" @@ -41,7 +38,7 @@ src_prepare() { if use dhcp; then eapply "${FILESDIR}/ppp-2.5.0-add-dhcp-plugin.patch" cd "${WORKDIR}/dhcp" || die - eapply "${WORKDIR}/ppp-2.5.0-dhcp-patches" + eapply "${FILESDIR}/ppp-2.5.0-dhcp" cd "${S}" || die mv "${WORKDIR}/dhcp" "${S}/pppd/plugins/dhcp" || die fi |