mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 10:31:51 +00:00
Update mptcpd
This commit is contained in:
parent
c40aad6baf
commit
a275eedf45
4 changed files with 177 additions and 31 deletions
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (C) 2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
# Copyright (C) 2020-2021 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
|
@ -8,10 +8,10 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ell
|
PKG_NAME:=ell
|
||||||
PKG_VERSION:=0.30
|
PKG_VERSION:=0.41
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_HASH:=51cf8cc66a9d1038e41f7d619ea5660aa4476904496562b2d45ca79370ca4a5e
|
PKG_HASH:=4e8dba6c53cf152dbd0fd1dc3d4c7b04abf79e20a948895f85943e586870505c
|
||||||
PKG_SOURCE_URL:=@KERNEL/linux/libs/ell
|
PKG_SOURCE_URL:=@KERNEL/linux/libs/ell
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
PKG_LICENSE_FILES:=GPL
|
PKG_LICENSE_FILES:=GPL
|
||||||
|
|
|
@ -8,13 +8,15 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=mptcpd
|
PKG_NAME:=mptcpd
|
||||||
PKG_VERSION:=0.5.1
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE_URL:=https://github.com/intel/mptcpd.git
|
||||||
PKG_SOURCE_URL:=https://github.com/intel/mptcpd/releases/download/v$(PKG_VERSION)
|
PKG_SOURCE_VERSION:=0e7175adf721c95a3bd742be77cb85e0b47138cd
|
||||||
PKG_HASH:=0ee4418880f20a1a2eff5c54c26185a75092cb44cbabe0fa3f25a2c5886459e7
|
PKG_VERSION:=0.7-$(PKG_SOURCE_VERSION)
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||||
|
|
||||||
|
PKG_FIXUP:=autoreconf
|
||||||
|
|
||||||
PKG_FORTIFY_SOURCE:=2
|
PKG_FORTIFY_SOURCE:=2
|
||||||
PKG_INSTALL:=1
|
PKG_INSTALL:=1
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
@ -43,6 +45,7 @@ endef
|
||||||
define Package/$(PKG_NAME)/install
|
define Package/$(PKG_NAME)/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/mptcpd $(1)/usr/bin/mptcpd
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/mptcpd $(1)/usr/bin/mptcpd
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/mptcpize $(1)/usr/bin/mptcpize
|
||||||
$(INSTALL_DIR) $(1)/usr/include/mptcpd
|
$(INSTALL_DIR) $(1)/usr/include/mptcpd
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/mptcpd/*.h $(1)/usr/include/
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/mptcpd/*.h $(1)/usr/include/
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/mptcpd
|
$(INSTALL_DIR) $(1)/usr/lib/mptcpd
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
--- a/src/configuration.c 2020-04-14 21:31:22.057292953 +0200
|
|
||||||
+++ b/src/configuration.c 2020-04-14 21:32:13.712364449 +0200
|
|
||||||
@@ -35,10 +35,10 @@
|
|
||||||
*/
|
|
||||||
//@{
|
|
||||||
/// Underlying string concatenation macro.
|
|
||||||
-#define MPTCPD_CONCAT_IMPL(x, ...) x ## __VA_ARGS__
|
|
||||||
+//#define MPTCPD_CONCAT_IMPL(x, ...) x ## __VA_ARGS__
|
|
||||||
|
|
||||||
/// Concatenate strings using the preprocessor.
|
|
||||||
-#define MPTCPD_CONCAT(x, ...) MPTCPD_CONCAT_IMPL(x, __VA_ARGS__)
|
|
||||||
+//#define MPTCPD_CONCAT(x, ...) MPTCPD_CONCAT_IMPL(x, __VA_ARGS__)
|
|
||||||
//@}
|
|
||||||
|
|
||||||
// Compile-time default logging choice
|
|
||||||
@@ -47,7 +47,7 @@
|
|
||||||
# error Problem configuring default log message destination.
|
|
||||||
#endif
|
|
||||||
/// Name of the default logging function determined at compile-time.
|
|
||||||
-#define MPTCPD_SET_LOG_FUNCTION MPTCPD_CONCAT(l_log_set_, MPTCPD_LOGGER)
|
|
||||||
+#define MPTCPD_SET_LOG_FUNCTION l_log_set_stderr
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Get the function that sets the log message destination.
|
|
167
mptcpd/patches/remove_log.patch
Normal file
167
mptcpd/patches/remove_log.patch
Normal file
|
@ -0,0 +1,167 @@
|
||||||
|
--- a/src/configuration.c 2021-06-29 17:44:20.481179981 +0200
|
||||||
|
+++ b/src/configuration.c 2021-06-29 17:44:52.580655950 +0200
|
||||||
|
@@ -37,21 +37,12 @@
|
||||||
|
* Preprocessor concatenation that expands preprocessor tokens as
|
||||||
|
* needed by leveraging the usual indirection technique.
|
||||||
|
*/
|
||||||
|
-///@{
|
||||||
|
-/// Underlying string concatenation macro.
|
||||||
|
-#define MPTCPD_CONCAT_IMPL(x, ...) x ## __VA_ARGS__
|
||||||
|
-
|
||||||
|
-/// Concatenate strings using the preprocessor.
|
||||||
|
-#define MPTCPD_CONCAT(x, ...) MPTCPD_CONCAT_IMPL(x, __VA_ARGS__)
|
||||||
|
-///@}
|
||||||
|
|
||||||
|
// Compile-time default logging choice
|
||||||
|
#ifndef MPTCPD_LOGGER
|
||||||
|
// This should never occur!
|
||||||
|
# error Problem configuring default log message destination.
|
||||||
|
#endif
|
||||||
|
-/// Name of the default logging function determined at compile-time.
|
||||||
|
-#define MPTCPD_SET_LOG_FUNCTION MPTCPD_CONCAT(l_log_set_, MPTCPD_LOGGER)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the function that sets the log message destination.
|
||||||
|
@@ -474,7 +465,6 @@
|
||||||
|
|
||||||
|
struct mptcpd_config *mptcpd_config_create(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
- MPTCPD_SET_LOG_FUNCTION(); // For early logging.
|
||||||
|
|
||||||
|
struct mptcpd_config *const config =
|
||||||
|
l_new(struct mptcpd_config, 1);
|
||||||
|
--- a/src/mptcpize.c 2021-06-29 19:29:57.810281053 +0200
|
||||||
|
+++ b/src/mptcpize.c 2021-06-29 19:29:29.942701557 +0200
|
||||||
|
@@ -17,7 +17,6 @@
|
||||||
|
#include <argp.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <errno.h>
|
||||||
|
-#include <error.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
@@ -79,7 +78,7 @@
|
||||||
|
nr++;
|
||||||
|
envp = calloc(nr + 3, sizeof(char *));
|
||||||
|
if (!envp)
|
||||||
|
- error(1, errno, "can't allocate env list");
|
||||||
|
+ fprintf(stderr, "can't allocate env list");
|
||||||
|
|
||||||
|
// ... filtering out any 'LD_PRELOAD' ...
|
||||||
|
nr = 0;
|
||||||
|
@@ -103,7 +102,7 @@
|
||||||
|
// build the NULL terminated arg list
|
||||||
|
argv = calloc(argc + 1, sizeof(char *));
|
||||||
|
if (!argv)
|
||||||
|
- error(1, errno, "can't allocate argument list");
|
||||||
|
+ fprintf(stderr, "can't allocate argument list");
|
||||||
|
|
||||||
|
memcpy(argv, av, argc * sizeof(char*));
|
||||||
|
return execvpe(argv[0], argv, envp);
|
||||||
|
@@ -124,33 +123,33 @@
|
||||||
|
len = strlen(name) + 1 + strlen(SYSTEMCTL_SHOW);
|
||||||
|
cmd = malloc(len);
|
||||||
|
if (!cmd)
|
||||||
|
- error(1, 0, "can't allocate systemctl command string");
|
||||||
|
+ fprintf(stderr, "can't allocate systemctl command string");
|
||||||
|
|
||||||
|
sprintf(cmd, SYSTEMCTL_SHOW"%s", name);
|
||||||
|
systemctl = popen(cmd, "r");
|
||||||
|
if (!systemctl)
|
||||||
|
- error(1, errno, "can't execute %s", cmd);
|
||||||
|
+ fprintf(stderr, "can't execute %s", cmd);
|
||||||
|
|
||||||
|
free(cmd);
|
||||||
|
while ((read = getline(&line, &len, systemctl)) != -1) {
|
||||||
|
if (strncmp(line, SYSTEMD_UNIT_VAR, strlen(SYSTEMD_UNIT_VAR)) == 0) {
|
||||||
|
char *ret = strdup(&line[strlen(SYSTEMD_UNIT_VAR)]);
|
||||||
|
if (!ret)
|
||||||
|
- error(1, errno, "failed to duplicate string");
|
||||||
|
+ fprintf(stderr, "failed to duplicate string");
|
||||||
|
|
||||||
|
// trim trailing newline, if any
|
||||||
|
len = strlen(ret);
|
||||||
|
if (len > 0 && ret[len - 1] == '\n')
|
||||||
|
ret[--len] = 0;
|
||||||
|
if (len == 0)
|
||||||
|
- error(1, 0, "can't find unit file for service %s", name);
|
||||||
|
+ fprintf(stderr, "can't find unit file for service %s", name);
|
||||||
|
free(line);
|
||||||
|
pclose(systemctl);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- error(1, 0, "can't find FragmentPath attribute for unit %s", name);
|
||||||
|
+ fprintf(stderr, "can't find FragmentPath attribute for unit %s", name);
|
||||||
|
|
||||||
|
// never reached: just silence gcc
|
||||||
|
return NULL;
|
||||||
|
@@ -175,12 +174,12 @@
|
||||||
|
unit = locate_unit(argv[0]);
|
||||||
|
src = fopen(unit, "r");
|
||||||
|
if (!src)
|
||||||
|
- error(1, errno, "can't open file %s", unit);
|
||||||
|
+ fprintf(stderr, "can't open file %s", unit);
|
||||||
|
|
||||||
|
strcpy(dst_path, "/tmp/unit_XXXXXX");
|
||||||
|
dst = mkstemp(dst_path);
|
||||||
|
if (dst < 0)
|
||||||
|
- error(1, errno, "can't create tmp file");
|
||||||
|
+ fprintf(stderr, "can't create tmp file");
|
||||||
|
|
||||||
|
// reset any prior error, to allow later check on errno
|
||||||
|
errno = 0;
|
||||||
|
@@ -194,27 +193,27 @@
|
||||||
|
|
||||||
|
if (!is_env) {
|
||||||
|
if (write(dst, line, read) < 0)
|
||||||
|
- error(1, errno, "can't write '%s' into %s", line, dst_path);
|
||||||
|
+ fprintf(stderr, "can't write '%s' into %s", line, dst_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (append_env &&
|
||||||
|
(is_env || strncmp(line, SYSTEMD_SERVICE_TAG, strlen(SYSTEMD_SERVICE_TAG)) == 0)) {
|
||||||
|
if (dprintf(dst, "%s%s\n", SYSTEMD_ENV_VAR, MPTCPWRAP_ENV) < 0)
|
||||||
|
- error(1, errno, "can't write to env string into %s", dst_path);
|
||||||
|
+ fprintf(stderr, "can't write to env string into %s", dst_path);
|
||||||
|
append_env = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (errno != 0)
|
||||||
|
- error(1, errno, "can't read from %s", unit);
|
||||||
|
+ fprintf(stderr, "can't read from %s", unit);
|
||||||
|
free(line);
|
||||||
|
fclose(src);
|
||||||
|
close(dst);
|
||||||
|
|
||||||
|
if (rename(dst_path, unit) < 0)
|
||||||
|
- error(1, errno, "can't rename %s to %s", dst_path, unit);
|
||||||
|
+ fprintf(stderr, "can't rename %s to %s", dst_path, unit);
|
||||||
|
|
||||||
|
if (system("systemctl daemon-reload") != 0)
|
||||||
|
- error(1, errno, "can't reload unit, manual 'systemctl daemon-reload' is required");
|
||||||
|
+ fprintf(stderr, "can't reload unit, manual 'systemctl daemon-reload' is required");
|
||||||
|
|
||||||
|
printf("mptcp successfully %s on unit %s\n",
|
||||||
|
enable ? "enabled" : "disabled", unit);
|
||||||
|
@@ -239,7 +238,7 @@
|
||||||
|
argp_program_version = "mptcpize "VERSION;
|
||||||
|
argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
|
||||||
|
if (argp_parse(&argp, argc, argv, ARGP_IN_ORDER, &idx, 0) < 0)
|
||||||
|
- error(1, errno, "can't parse arguments");
|
||||||
|
+ fprintf(stderr, "can't parse arguments");
|
||||||
|
|
||||||
|
argc -= idx;
|
||||||
|
argv += idx;
|
||||||
|
--- a/src/mptcpize.c 2021-07-05 20:06:07.035838944 +0200
|
||||||
|
+++ b/src/mptcpize.c 2021-07-05 20:06:26.875505617 +0200
|
||||||
|
@@ -7,8 +7,6 @@
|
||||||
|
* Copyright (c) 2021, Red Hat, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
-#define _GNU_SOURCE
|
||||||
|
-
|
||||||
|
#include <linux/limits.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
Loading…
Reference in a new issue