aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorGianfranco Costamagna <costamagna.gianfranco@gmail.com>2019-08-28 15:53:37 +0200
committerKhem Raj <raj.khem@gmail.com>2019-08-29 09:06:54 -0700
commitf2487da39452ee150177daf3af93d1a54e3acf2d (patch)
tree746075fc0fde9ece1747a7325d5b2d40f854f3a3 /meta-networking
parent23adcea49542da2ce2906ff862201cd9f6c37f35 (diff)
downloadmeta-openembedded-contrib-f2487da39452ee150177daf3af93d1a54e3acf2d.tar.gz
ifmetric: add initial recipe based on Debian packaging and patches
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.8_typo.patch15
-rw-r--r--meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.c_netlink-invalid-arg.patch16
-rw-r--r--meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.c_typo.patch24
-rw-r--r--meta-networking/recipes-support/ifmetric/ifmetric/nlrequest.c_packet-too-small_fix.patch16
-rw-r--r--meta-networking/recipes-support/ifmetric/ifmetric_0.3.bb17
5 files changed, 88 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.8_typo.patch b/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.8_typo.patch
new file mode 100644
index 0000000000..246910036e
--- /dev/null
+++ b/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.8_typo.patch
@@ -0,0 +1,15 @@
+Description: Correct typo: s/ommited/omitted/
+Author: Michael Shuler <michael@pbandjelly.org>
+Index: ifmetric/man/ifmetric.8
+===================================================================
+--- ifmetric.orig/man/ifmetric.8
++++ ifmetric/man/ifmetric.8
+@@ -9,7 +9,7 @@ ifmetric is a Linux tool for setting the
+
+ ifmetric uses the Linux NETLINK interface to manipulate the routes. Because of that it is compatible with routes created with the new iproute2 utility.
+ .SH OPTIONS
+-You should specify the interface name as first parameter. The second parameter should be the new metric. If ommited the metric 0 (highest) is used.
++You should specify the interface name as first parameter. The second parameter should be the new metric. If omitted the metric 0 (highest) is used.
+ .SH RETURN VALUES
+ \fI0\f1 Success
+
diff --git a/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.c_netlink-invalid-arg.patch b/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.c_netlink-invalid-arg.patch
new file mode 100644
index 0000000000..374135d4f6
--- /dev/null
+++ b/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.c_netlink-invalid-arg.patch
@@ -0,0 +1,16 @@
+Description: Fix "NETLINK: Error: Invalid argument" for links that are down, in kernel 4.4+
+Author: Jim Paris <jim@jtan.com>
+Bug-Debian: http://bugs.debian.org/864889
+Index: ifmetric/src/nlrequest.c
+===================================================================
+--- a/src/ifmetric.c
++++ b/src/ifmetric.c
+@@ -97,6 +97,8 @@
+ l = NLMSG_PAYLOAD(n, sizeof(struct rtmsg));
+ a = RTM_RTA(r);
+
++ r->rtm_flags &= ~(RTNH_F_DEAD | RTNH_F_LINKDOWN);
++
+ while(RTA_OK(a, l)) {
+ switch(a->rta_type) {
+ case RTA_PRIORITY:
diff --git a/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.c_typo.patch b/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.c_typo.patch
new file mode 100644
index 0000000000..992f7d2fbb
--- /dev/null
+++ b/meta-networking/recipes-support/ifmetric/ifmetric/ifmetric.c_typo.patch
@@ -0,0 +1,24 @@
+Description: Correct spelling-error-in-binary s/Recieved/Received/
+Author: Michael Shuler <michael@pbandjelly.org>
+Index: ifmetric/src/ifmetric.c
+===================================================================
+--- ifmetric.orig/src/ifmetric.c 2013-09-04 18:37:59.000000000 -0500
++++ ifmetric/src/ifmetric.c 2013-09-04 19:08:38.539750778 -0500
+@@ -38,7 +38,7 @@
+ case RTA_OIF:
+
+ if (RTA_PAYLOAD(a) != sizeof(int)) {
+- fprintf(stderr, "NETLINK: Recieved corrupt RTA_OIF payload.\n");
++ fprintf(stderr, "NETLINK: Received corrupt RTA_OIF payload.\n");
+ return -1;
+ }
+
+@@ -102,7 +102,7 @@
+ case RTA_PRIORITY:
+
+ if (RTA_PAYLOAD(a) != sizeof(int)) {
+- fprintf(stderr, "NETLINK: Recieved corrupt RTA_PRIORITY payload.\n");
++ fprintf(stderr, "NETLINK: Received corrupt RTA_PRIORITY payload.\n");
+ return NULL;
+ }
+
diff --git a/meta-networking/recipes-support/ifmetric/ifmetric/nlrequest.c_packet-too-small_fix.patch b/meta-networking/recipes-support/ifmetric/ifmetric/nlrequest.c_packet-too-small_fix.patch
new file mode 100644
index 0000000000..15b3103334
--- /dev/null
+++ b/meta-networking/recipes-support/ifmetric/ifmetric/nlrequest.c_packet-too-small_fix.patch
@@ -0,0 +1,16 @@
+Description: Fix "NETLINK: Packet too small or truncated!" error.
+Author: Benedek László <benedekl@gmail.com>
+Bug-Debian: http://bugs.debian.org/514197
+Index: ifmetric/src/nlrequest.c
+===================================================================
+--- ifmetric.orig/src/nlrequest.c 2013-09-05 14:10:42.000000000 -0500
++++ ifmetric/src/nlrequest.c 2013-09-05 14:19:06.573420862 -0500
+@@ -44,7 +44,7 @@
+
+ for (;;) {
+ int bytes;
+- char replybuf[2048];
++ char replybuf[4096];
+ struct nlmsghdr *p = (struct nlmsghdr *) replybuf;
+
+ if ((bytes = recv(s, &replybuf, sizeof(replybuf), 0)) < 0) {
diff --git a/meta-networking/recipes-support/ifmetric/ifmetric_0.3.bb b/meta-networking/recipes-support/ifmetric/ifmetric_0.3.bb
new file mode 100644
index 0000000000..4ee7c42a35
--- /dev/null
+++ b/meta-networking/recipes-support/ifmetric/ifmetric_0.3.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "Set routing metrics for a network interface"
+
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://0pointer.de/lennart/projects/ifmetric/ifmetric-${PV}.tar.gz \
+ file://ifmetric.8_typo.patch \
+ file://ifmetric.c_netlink-invalid-arg.patch \
+ file://ifmetric.c_typo.patch \
+ file://nlrequest.c_packet-too-small_fix.patch"
+SRC_URI[md5sum] = "74aa3f5ee8aca16a87e124ddcc64fa36"
+SRC_URI[sha256sum] = "0fa8510a4e34e555f136f9df81d26618313f2d69a4880c0fb5967f19502f1aec"
+
+inherit autotools
+
+# disable lynx support for now
+EXTRA_OECONF = "--disable-lynx"