aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/0001-ifupdown-support-link-address-family.patch
blob: c9102c865ff3575ac9599de86b749742b37f67bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 93f75fe7ab255147e67517dc9c9bd19e3faa6568 Mon Sep 17 00:00:00 2001
From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Date: Sat, 21 Dec 2013 17:32:57 +0200
Subject: [PATCH] ifupdown: support 'link' address family

Does not configure anything. L2 configuration hook scripts should do
their job on receiving ADDRFAM=link. Configuration will be done only
once, irrespective of L3 protocols used.

Using the 'link' family in the interfaces file conforms to the Debian
implementation:

http://sources.debian.net/src/ifupdown/0.7.47.1/link.defn

Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
---
 networking/ifupdown.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 0f0857c..91a786d 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -685,6 +685,18 @@ static const struct address_family_t addr_inet = {
 
 #endif  /* FEATURE_IFUPDOWN_IPV4 */
 
+static int FAST_FUNC link_up_down(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM)
+{
+	return 1;
+}
+
+static const struct method_t link_methods[] = {
+	{"none", link_up_down, link_up_down}
+};
+
+static const struct address_family_t addr_link = {
+	"link", ARRAY_SIZE(link_methods), link_methods
+};
 
 /* Returns pointer to the next word, or NULL.
  * In 1st case, advances *buf to the word after this one.
@@ -831,6 +843,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename, struct in
 #if ENABLE_FEATURE_IFUPDOWN_IPV6
 				&addr_inet6,
 #endif
+				&addr_link,
 				NULL
 			};
 			char *iface_name;
-- 
1.8.1.4