diff options
author | Gianfranco Costamagna <costamagna.gianfranco@gmail.com> | 2019-08-28 15:53:37 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-08-29 09:06:54 -0700 |
commit | f2487da39452ee150177daf3af93d1a54e3acf2d (patch) | |
tree | 746075fc0fde9ece1747a7325d5b2d40f854f3a3 | |
parent | 23adcea49542da2ce2906ff862201cd9f6c37f35 (diff) | |
download | meta-openembedded-f2487da39452ee150177daf3af93d1a54e3acf2d.tar.gz |
ifmetric: add initial recipe based on Debian packaging and patches
Signed-off-by: Khem Raj <raj.khem@gmail.com>
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 @@ | |||
1 | Description: Correct typo: s/ommited/omitted/ | ||
2 | Author: Michael Shuler <michael@pbandjelly.org> | ||
3 | Index: ifmetric/man/ifmetric.8 | ||
4 | =================================================================== | ||
5 | --- ifmetric.orig/man/ifmetric.8 | ||
6 | +++ ifmetric/man/ifmetric.8 | ||
7 | @@ -9,7 +9,7 @@ ifmetric is a Linux tool for setting the | ||
8 | |||
9 | ifmetric uses the Linux NETLINK interface to manipulate the routes. Because of that it is compatible with routes created with the new iproute2 utility. | ||
10 | .SH OPTIONS | ||
11 | -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. | ||
12 | +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. | ||
13 | .SH RETURN VALUES | ||
14 | \fI0\f1 Success | ||
15 | |||
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 @@ | |||
1 | Description: Fix "NETLINK: Error: Invalid argument" for links that are down, in kernel 4.4+ | ||
2 | Author: Jim Paris <jim@jtan.com> | ||
3 | Bug-Debian: http://bugs.debian.org/864889 | ||
4 | Index: ifmetric/src/nlrequest.c | ||
5 | =================================================================== | ||
6 | --- a/src/ifmetric.c | ||
7 | +++ b/src/ifmetric.c | ||
8 | @@ -97,6 +97,8 @@ | ||
9 | l = NLMSG_PAYLOAD(n, sizeof(struct rtmsg)); | ||
10 | a = RTM_RTA(r); | ||
11 | |||
12 | + r->rtm_flags &= ~(RTNH_F_DEAD | RTNH_F_LINKDOWN); | ||
13 | + | ||
14 | while(RTA_OK(a, l)) { | ||
15 | switch(a->rta_type) { | ||
16 | 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 @@ | |||
1 | Description: Correct spelling-error-in-binary s/Recieved/Received/ | ||
2 | Author: Michael Shuler <michael@pbandjelly.org> | ||
3 | Index: ifmetric/src/ifmetric.c | ||
4 | =================================================================== | ||
5 | --- ifmetric.orig/src/ifmetric.c 2013-09-04 18:37:59.000000000 -0500 | ||
6 | +++ ifmetric/src/ifmetric.c 2013-09-04 19:08:38.539750778 -0500 | ||
7 | @@ -38,7 +38,7 @@ | ||
8 | case RTA_OIF: | ||
9 | |||
10 | if (RTA_PAYLOAD(a) != sizeof(int)) { | ||
11 | - fprintf(stderr, "NETLINK: Recieved corrupt RTA_OIF payload.\n"); | ||
12 | + fprintf(stderr, "NETLINK: Received corrupt RTA_OIF payload.\n"); | ||
13 | return -1; | ||
14 | } | ||
15 | |||
16 | @@ -102,7 +102,7 @@ | ||
17 | case RTA_PRIORITY: | ||
18 | |||
19 | if (RTA_PAYLOAD(a) != sizeof(int)) { | ||
20 | - fprintf(stderr, "NETLINK: Recieved corrupt RTA_PRIORITY payload.\n"); | ||
21 | + fprintf(stderr, "NETLINK: Received corrupt RTA_PRIORITY payload.\n"); | ||
22 | return NULL; | ||
23 | } | ||
24 | |||
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 @@ | |||
1 | Description: Fix "NETLINK: Packet too small or truncated!" error. | ||
2 | Author: Benedek László <benedekl@gmail.com> | ||
3 | Bug-Debian: http://bugs.debian.org/514197 | ||
4 | Index: ifmetric/src/nlrequest.c | ||
5 | =================================================================== | ||
6 | --- ifmetric.orig/src/nlrequest.c 2013-09-05 14:10:42.000000000 -0500 | ||
7 | +++ ifmetric/src/nlrequest.c 2013-09-05 14:19:06.573420862 -0500 | ||
8 | @@ -44,7 +44,7 @@ | ||
9 | |||
10 | for (;;) { | ||
11 | int bytes; | ||
12 | - char replybuf[2048]; | ||
13 | + char replybuf[4096]; | ||
14 | struct nlmsghdr *p = (struct nlmsghdr *) replybuf; | ||
15 | |||
16 | 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 @@ | |||
1 | DESCRIPTION = "Set routing metrics for a network interface" | ||
2 | |||
3 | LICENSE = "GPL-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
5 | |||
6 | SRC_URI = "http://0pointer.de/lennart/projects/ifmetric/ifmetric-${PV}.tar.gz \ | ||
7 | file://ifmetric.8_typo.patch \ | ||
8 | file://ifmetric.c_netlink-invalid-arg.patch \ | ||
9 | file://ifmetric.c_typo.patch \ | ||
10 | file://nlrequest.c_packet-too-small_fix.patch" | ||
11 | SRC_URI[md5sum] = "74aa3f5ee8aca16a87e124ddcc64fa36" | ||
12 | SRC_URI[sha256sum] = "0fa8510a4e34e555f136f9df81d26618313f2d69a4880c0fb5967f19502f1aec" | ||
13 | |||
14 | inherit autotools | ||
15 | |||
16 | # disable lynx support for now | ||
17 | EXTRA_OECONF = "--disable-lynx" | ||