diff options
author | André Draszik <adraszik@tycoint.com> | 2017-06-09 14:37:50 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 15:08:31 +0100 |
commit | bd2b33486e647c6e7f1351270d5bca4d300d18b5 (patch) | |
tree | a012b87387e251f8002178492ec44bcfd90729f2 /meta/recipes-core | |
parent | 66683198cf22d2dc0b18ec4d5f2218a51b8a1685 (diff) | |
download | poky-bd2b33486e647c6e7f1351270d5bca4d300d18b5.tar.gz |
busybox: add backported patch to support iproute 'scope'
This is needed for avahi-autoipd, which attempts to
create a link-scope route as part of its work.
Without iproute scope support in busybox, the route is
not created due to an error message, and hence we
aren't accessible by, and can't access ourselves,
IP addresses outside the link-local scope
(169.254.0.0/16) unless we also have a proper
non link-local IP address, which somehow defeats the
purpose of zeroconf.
(From OE-Core rev: bd06a1cbe8e97b7f66979b12d4d248092379df4a)
Signed-off-by: André Draszik <adraszik@tycoint.com>
Reviewed-by: Stephane Ayotte <sayotte@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
3 files changed, 157 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-ip-fix-an-improper-optimization-req.r.rtm_scope-may-.patch b/meta/recipes-core/busybox/busybox/0001-ip-fix-an-improper-optimization-req.r.rtm_scope-may-.patch new file mode 100644 index 0000000000..812a507489 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/0001-ip-fix-an-improper-optimization-req.r.rtm_scope-may-.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 34ecc3b7aefdd6c31e8691bd5485037bbabedbd4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Denys Vlasenko <vda.linux@googlemail.com> | ||
3 | Date: Sun, 14 Aug 2016 01:30:34 +0200 | ||
4 | Subject: [PATCH] ip: fix an improper optimization: req.r.rtm_scope may be | ||
5 | nonzero here | ||
6 | |||
7 | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> | ||
8 | --- | ||
9 | Upstream-Status: Backport | ||
10 | Signed-off-by: André Draszik <adraszik@tycoint.com> | ||
11 | |||
12 | networking/libiproute/iproute.c | 3 +-- | ||
13 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c | ||
16 | index e674e9a0d..48dc6e3d9 100644 | ||
17 | --- a/networking/libiproute/iproute.c | ||
18 | +++ b/networking/libiproute/iproute.c | ||
19 | @@ -362,10 +362,9 @@ IF_FEATURE_IP_RULE(ARG_table,) | ||
20 | req.r.rtm_scope = RT_SCOPE_NOWHERE; | ||
21 | |||
22 | if (cmd != RTM_DELROUTE) { | ||
23 | + req.r.rtm_scope = RT_SCOPE_UNIVERSE; | ||
24 | if (RTPROT_BOOT != 0) | ||
25 | req.r.rtm_protocol = RTPROT_BOOT; | ||
26 | - if (RT_SCOPE_UNIVERSE != 0) | ||
27 | - req.r.rtm_scope = RT_SCOPE_UNIVERSE; | ||
28 | if (RTN_UNICAST != 0) | ||
29 | req.r.rtm_type = RTN_UNICAST; | ||
30 | } | ||
31 | -- | ||
32 | 2.11.0 | ||
33 | |||
diff --git a/meta/recipes-core/busybox/busybox/0001-iproute-support-scope-.-Closes-8561.patch b/meta/recipes-core/busybox/busybox/0001-iproute-support-scope-.-Closes-8561.patch new file mode 100644 index 0000000000..66bc76e65e --- /dev/null +++ b/meta/recipes-core/busybox/busybox/0001-iproute-support-scope-.-Closes-8561.patch | |||
@@ -0,0 +1,122 @@ | |||
1 | From ce4bc1ed048233e89ee4cb95830bf6f01d523d1e Mon Sep 17 00:00:00 2001 | ||
2 | From: Denys Vlasenko <vda.linux@googlemail.com> | ||
3 | Date: Wed, 30 Dec 2015 17:32:51 +0100 | ||
4 | Subject: [PATCH] iproute: support "scope". Closes 8561 | ||
5 | |||
6 | function old new delta | ||
7 | iproute_modify 1051 1120 +69 | ||
8 | |||
9 | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | Modified patch to build against busybox 1.24.1: | ||
13 | - s/invarg_1_to_2/invarg | ||
14 | Signed-off-by: André Draszik <adraszik@tycoint.com> | ||
15 | --- | ||
16 | networking/libiproute/iproute.c | 52 ++++++++++++++++++++++++++--------------- | ||
17 | 1 file changed, 33 insertions(+), 19 deletions(-) | ||
18 | |||
19 | diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c | ||
20 | index d232ee6fd..82827488f 100644 | ||
21 | --- a/networking/libiproute/iproute.c | ||
22 | +++ b/networking/libiproute/iproute.c | ||
23 | @@ -313,12 +313,13 @@ static int FAST_FUNC print_route(const struct sockaddr_nl *who UNUSED_PARAM, | ||
24 | static int iproute_modify(int cmd, unsigned flags, char **argv) | ||
25 | { | ||
26 | static const char keywords[] ALIGN1 = | ||
27 | - "src\0""via\0""mtu\0""lock\0""protocol\0"IF_FEATURE_IP_RULE("table\0") | ||
28 | + "src\0""via\0""mtu\0""lock\0""scope\0""protocol\0"IF_FEATURE_IP_RULE("table\0") | ||
29 | "dev\0""oif\0""to\0""metric\0""onlink\0"; | ||
30 | enum { | ||
31 | ARG_src, | ||
32 | ARG_via, | ||
33 | ARG_mtu, PARM_lock, | ||
34 | + ARG_scope, | ||
35 | ARG_protocol, | ||
36 | IF_FEATURE_IP_RULE(ARG_table,) | ||
37 | ARG_dev, | ||
38 | @@ -344,6 +345,7 @@ IF_FEATURE_IP_RULE(ARG_table,) | ||
39 | unsigned mxlock = 0; | ||
40 | char *d = NULL; | ||
41 | smalluint ok = 0; | ||
42 | + smalluint scope_ok = 0; | ||
43 | int arg; | ||
44 | |||
45 | memset(&req, 0, sizeof(req)); | ||
46 | @@ -352,15 +354,18 @@ IF_FEATURE_IP_RULE(ARG_table,) | ||
47 | req.n.nlmsg_flags = NLM_F_REQUEST | flags; | ||
48 | req.n.nlmsg_type = cmd; | ||
49 | req.r.rtm_family = preferred_family; | ||
50 | - if (RT_TABLE_MAIN) /* if it is zero, memset already did it */ | ||
51 | + if (RT_TABLE_MAIN != 0) /* if it is zero, memset already did it */ | ||
52 | req.r.rtm_table = RT_TABLE_MAIN; | ||
53 | - if (RT_SCOPE_NOWHERE) | ||
54 | + if (RT_SCOPE_NOWHERE != 0) | ||
55 | req.r.rtm_scope = RT_SCOPE_NOWHERE; | ||
56 | |||
57 | if (cmd != RTM_DELROUTE) { | ||
58 | - req.r.rtm_protocol = RTPROT_BOOT; | ||
59 | - req.r.rtm_scope = RT_SCOPE_UNIVERSE; | ||
60 | - req.r.rtm_type = RTN_UNICAST; | ||
61 | + if (RTPROT_BOOT != 0) | ||
62 | + req.r.rtm_protocol = RTPROT_BOOT; | ||
63 | + if (RT_SCOPE_UNIVERSE != 0) | ||
64 | + req.r.rtm_scope = RT_SCOPE_UNIVERSE; | ||
65 | + if (RTN_UNICAST != 0) | ||
66 | + req.r.rtm_type = RTN_UNICAST; | ||
67 | } | ||
68 | |||
69 | mxrta->rta_type = RTA_METRICS; | ||
70 | @@ -393,6 +398,13 @@ IF_FEATURE_IP_RULE(ARG_table,) | ||
71 | } | ||
72 | mtu = get_unsigned(*argv, "mtu"); | ||
73 | rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu); | ||
74 | + } else if (arg == ARG_scope) { | ||
75 | + uint32_t scope; | ||
76 | + NEXT_ARG(); | ||
77 | + if (rtnl_rtscope_a2n(&scope, *argv)) | ||
78 | + invarg(*argv, "scope"); | ||
79 | + req.r.rtm_scope = scope; | ||
80 | + scope_ok = 1; | ||
81 | } else if (arg == ARG_protocol) { | ||
82 | uint32_t prot; | ||
83 | NEXT_ARG(); | ||
84 | @@ -469,20 +481,22 @@ IF_FEATURE_IP_RULE(ARG_table,) | ||
85 | addattr_l(&req.n, sizeof(req), RTA_METRICS, RTA_DATA(mxrta), RTA_PAYLOAD(mxrta)); | ||
86 | } | ||
87 | |||
88 | - if (req.r.rtm_type == RTN_LOCAL || req.r.rtm_type == RTN_NAT) | ||
89 | - req.r.rtm_scope = RT_SCOPE_HOST; | ||
90 | - else | ||
91 | - if (req.r.rtm_type == RTN_BROADCAST | ||
92 | - || req.r.rtm_type == RTN_MULTICAST | ||
93 | - || req.r.rtm_type == RTN_ANYCAST | ||
94 | - ) { | ||
95 | - req.r.rtm_scope = RT_SCOPE_LINK; | ||
96 | - } | ||
97 | - else if (req.r.rtm_type == RTN_UNICAST || req.r.rtm_type == RTN_UNSPEC) { | ||
98 | - if (cmd == RTM_DELROUTE) | ||
99 | - req.r.rtm_scope = RT_SCOPE_NOWHERE; | ||
100 | - else if (!(ok & gw_ok)) | ||
101 | + if (!scope_ok) { | ||
102 | + if (req.r.rtm_type == RTN_LOCAL || req.r.rtm_type == RTN_NAT) | ||
103 | + req.r.rtm_scope = RT_SCOPE_HOST; | ||
104 | + else | ||
105 | + if (req.r.rtm_type == RTN_BROADCAST | ||
106 | + || req.r.rtm_type == RTN_MULTICAST | ||
107 | + || req.r.rtm_type == RTN_ANYCAST | ||
108 | + ) { | ||
109 | req.r.rtm_scope = RT_SCOPE_LINK; | ||
110 | + } | ||
111 | + else if (req.r.rtm_type == RTN_UNICAST || req.r.rtm_type == RTN_UNSPEC) { | ||
112 | + if (cmd == RTM_DELROUTE) | ||
113 | + req.r.rtm_scope = RT_SCOPE_NOWHERE; | ||
114 | + else if (!(ok & gw_ok)) | ||
115 | + req.r.rtm_scope = RT_SCOPE_LINK; | ||
116 | + } | ||
117 | } | ||
118 | |||
119 | if (req.r.rtm_family == AF_UNSPEC) { | ||
120 | -- | ||
121 | 2.11.0 | ||
122 | |||
diff --git a/meta/recipes-core/busybox/busybox_1.24.1.bb b/meta/recipes-core/busybox/busybox_1.24.1.bb index d3df448557..1c8580876a 100644 --- a/meta/recipes-core/busybox/busybox_1.24.1.bb +++ b/meta/recipes-core/busybox/busybox_1.24.1.bb | |||
@@ -59,6 +59,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ | |||
59 | file://ifupdown-pass-interface-device-name-for-ipv6-route-c.patch \ | 59 | file://ifupdown-pass-interface-device-name-for-ipv6-route-c.patch \ |
60 | file://BUG9071_buffer_overflow_arp.patch \ | 60 | file://BUG9071_buffer_overflow_arp.patch \ |
61 | file://busybox-tar-add-IF_FEATURE_-checks.patch \ | 61 | file://busybox-tar-add-IF_FEATURE_-checks.patch \ |
62 | file://0001-iproute-support-scope-.-Closes-8561.patch \ | ||
63 | file://0001-ip-fix-an-improper-optimization-req.r.rtm_scope-may-.patch \ | ||
62 | " | 64 | " |
63 | SRC_URI_append_libc-musl = " file://musl.cfg " | 65 | SRC_URI_append_libc-musl = " file://musl.cfg " |
64 | 66 | ||