diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/ifplugd/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/ifplugd/files')
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-interface.patch | 13 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-musl.patch | 19 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff | 12 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-noip.patch | 21 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch | 63 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd.action | 55 |
6 files changed, 183 insertions, 0 deletions
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch b/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch new file mode 100644 index 000000000000..f99f3a26aed7 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch @@ -0,0 +1,13 @@ +--- a/src/interface.c ++++ b/src/interface.c +@@ -22,9 +22,9 @@ + #include <config.h> + #endif + ++#include <sys/types.h> + #include <linux/sockios.h> + #include <linux/if_ether.h> +-#include <sys/types.h> + #include <sys/socket.h> + #include <sys/ioctl.h> + #include <linux/if.h> diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-musl.patch b/sys-apps/ifplugd/files/ifplugd-0.28-musl.patch new file mode 100644 index 000000000000..ecaaabfe266e --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-musl.patch @@ -0,0 +1,19 @@ +--- a/src/ethtool-local.h ++++ b/src/ethtool-local.h +@@ -21,10 +21,12 @@ + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +-typedef unsigned long long u64; +-typedef __uint32_t u32; +-typedef __uint16_t u16; +-typedef __uint8_t u8; ++#include <stdint.h> ++ ++typedef uint64_t u64; ++typedef uint32_t u32; ++typedef uint16_t u16; ++typedef uint8_t u8; + + #include "ethtool-kernel.h" + diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff b/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff new file mode 100644 index 000000000000..a3d128f20ff4 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff @@ -0,0 +1,12 @@ +diff -urN src/nlapi.c src/nlapi.c +--- a/src/nlapi.c ++++ b/src/nlapi.c +@@ -86,7 +86,7 @@ + for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) { + struct callback_info *c; + +- if (!NLMSG_OK(p, bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < p->nlmsg_len) { ++ if (!NLMSG_OK(p, (size_t) bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < (size_t) p->nlmsg_len) { + daemon_log(LOG_ERR, "NLAPI: Packet too small or truncated!\n"); + return -1; + } diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch b/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch new file mode 100644 index 000000000000..5daa4534eb49 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch @@ -0,0 +1,21 @@ +[PATCH] Allow ifplugd to run when no TCP/IP is available + +This simple patch create AF_LOCAL socket instead of AF_INET so if TCP/IP +is not linked into kernel it still works. + +Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> + +--- + +diff -urNp ifplugd-0.28.org/src/ifplugd.c ifplugd-0.28/src/ifplugd.c +--- ifplugd-0.28.org/src/ifplugd.c 2005-06-04 22:21:51.000000000 +0300 ++++ ifplugd-0.28/src/ifplugd.c 2007-10-30 05:22:53.000000000 +0200 +@@ -409,7 +409,7 @@ void work(void) { + break; + } + +- if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { ++ if ((fd = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) { + daemon_log(LOG_ERR, "socket(): %s", strerror(errno)); + goto finish; + } diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch new file mode 100644 index 000000000000..ae8292dc17ac --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch @@ -0,0 +1,63 @@ +--- a/src/interface.c ++++ b/src/interface.c +@@ -89,6 +89,10 @@ + + interface_status_t interface_detect_beat_mii(int fd, char *iface) { + struct ifreq ifr; ++ union { ++ caddr_t *data; ++ unsigned short *usz; ++ } ifd; + + if (interface_auto_up) + interface_up(fd, iface); +@@ -103,7 +107,8 @@ + return IFSTATUS_ERR; + } + +- ((unsigned short*) &ifr.ifr_data)[1] = 1; ++ ifd.data = &ifr.ifr_data; ++ *++ifd.usz = 1; + + if (ioctl(fd, SIOCGMIIREG, &ifr) == -1) { + if (interface_do_message) +@@ -112,12 +117,17 @@ + return IFSTATUS_ERR; + } + +- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; ++ ifd.usz += 2; ++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; + } + + interface_status_t interface_detect_beat_priv(int fd, char *iface) { + struct ifreq ifr; +- ++ union { ++ caddr_t *data; ++ unsigned short *usz; ++ } ifd; ++ + if (interface_auto_up) + interface_up(fd, iface); + +@@ -131,7 +141,8 @@ + return IFSTATUS_ERR; + } + +- ((unsigned short*) &ifr.ifr_data)[1] = 1; ++ ifd.data = &ifr.ifr_data; ++ *++ifd.usz = 1; + + if (ioctl(fd, SIOCDEVPRIVATE+1, &ifr) == -1) { + if (interface_do_message) +@@ -140,7 +151,8 @@ + return IFSTATUS_ERR; + } + +- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; ++ ifd.usz += 2; ++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; + } + + interface_status_t interface_detect_beat_ethtool(int fd, char *iface) { diff --git a/sys-apps/ifplugd/files/ifplugd.action b/sys-apps/ifplugd/files/ifplugd.action new file mode 100644 index 000000000000..ba4cfd7d20b9 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd.action @@ -0,0 +1,55 @@ +#!/bin/sh +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# +# Gentoo-specific ifplugd.action +# +# This file gets called by ifplugd when it wants to bring an interface +# up or down. +# + +if grep -q initng /proc/1/cmdline +then + EXEC="/sbin/ngc" + INITNG="yes" +else + EXEC="/etc/init.d/net.$1" + INITNG="no" +fi + +case "$2" in + up) + if [ "${INITNG}" = "yes" ] + then + ARGS="-u net/$1" + else + ARGS="--quiet start" + fi + ;; + down) + if [ "${INITNG}" = "yes" ] + then + ARGS="-d net/$1" + else + ARGS="--quiet stop" + fi + ;; + *) + echo "$0: wrong arguments" >&2 + echo "Call with <interface> <up|down>" >&2 + exit 1 + ;; +esac + +export IN_BACKGROUND=true + +if [ -x "${EXEC}" ] +then + ${EXEC} ${ARGS} + exit 0 +else + logger -t ifplugd.action "Error: Couldn't configure $1, no ${EXEC} !" + exit 1 +fi + +# vim: set ts=4 |