[oe-commits] [meta-openembedded] 13/28: ifmetric: add initial recipe based on Debian packaging and patches

git at git.openembedded.org git at git.openembedded.org
Thu Aug 29 16:09:03 UTC 2019


This is an automated email from the git hooks/post-receive script.

khem pushed a commit to branch master-next
in repository meta-openembedded.

commit f2487da39452ee150177daf3af93d1a54e3acf2d
Author: Gianfranco Costamagna <costamagna.gianfranco at gmail.com>
AuthorDate: Wed Aug 28 15:53:37 2019 +0200

    ifmetric: add initial recipe based on Debian packaging and patches
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 .../ifmetric/ifmetric/ifmetric.8_typo.patch        | 15 ++++++++++++++
 .../ifmetric/ifmetric.c_netlink-invalid-arg.patch  | 16 +++++++++++++++
 .../ifmetric/ifmetric/ifmetric.c_typo.patch        | 24 ++++++++++++++++++++++
 .../nlrequest.c_packet-too-small_fix.patch         | 16 +++++++++++++++
 .../recipes-support/ifmetric/ifmetric_0.3.bb       | 17 +++++++++++++++
 5 files changed, 88 insertions(+)

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 0000000..2469100
--- /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 at 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 0000000..374135d
--- /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 at 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 0000000..992f7d2
--- /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 at 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 0000000..15b3103
--- /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 at 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 0000000..4ee7c42
--- /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"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list