aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-02-03 15:56:20 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2014-02-03 15:56:20 +0100
commitfe8390e0fe7106aed9f586b3cf08215effc4450b (patch)
treeee3728e44b84055424375a1024c031d052855b5b
parentd353bfff467517608af7468198431d32406bb943 (diff)
downloadbusybox-w32-fe8390e0fe7106aed9f586b3cf08215effc4450b.tar.gz
busybox-w32-fe8390e0fe7106aed9f586b3cf08215effc4450b.tar.bz2
busybox-w32-fe8390e0fe7106aed9f586b3cf08215effc4450b.zip
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 function old new delta link_methods - 12 +12 addr_link - 12 +12 link_up_down - 6 +6 static.addr_fams 12 16 +4 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 1/0 up/down: 34/0) Total: 34 bytes Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ifupdown.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 0f0857cb4..e1ea351a4 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -685,6 +685,18 @@ static const struct address_family_t addr_inet = {
685 685
686#endif /* FEATURE_IFUPDOWN_IPV4 */ 686#endif /* FEATURE_IFUPDOWN_IPV4 */
687 687
688static int FAST_FUNC link_up_down(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM)
689{
690 return 1;
691}
692
693static const struct method_t link_methods[] = {
694 { "none", link_up_down, link_up_down }
695};
696
697static const struct address_family_t addr_link = {
698 "link", ARRAY_SIZE(link_methods), link_methods
699};
688 700
689/* Returns pointer to the next word, or NULL. 701/* Returns pointer to the next word, or NULL.
690 * In 1st case, advances *buf to the word after this one. 702 * 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
831#if ENABLE_FEATURE_IFUPDOWN_IPV6 843#if ENABLE_FEATURE_IFUPDOWN_IPV6
832 &addr_inet6, 844 &addr_inet6,
833#endif 845#endif
846 &addr_link,
834 NULL 847 NULL
835 }; 848 };
836 char *iface_name; 849 char *iface_name;