summaryrefslogtreecommitdiffstats
path: root/main/busybox
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-05-11 08:22:35 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-05-11 15:04:39 +0000
commit57c239705f8015256d026af6b5d5f7651757d9bd (patch)
tree98e41459f62e80c3db772c1695262b8877f6db8e /main/busybox
parenta24ed08595002aed165dd505b0d162e559cc37eb (diff)
downloadaports-57c239705f8015256d026af6b5d5f7651757d9bd.tar.bz2
aports-57c239705f8015256d026af6b5d5f7651757d9bd.tar.xz
main/busybox: backport ifupdown metric support
Diffstat (limited to 'main/busybox')
-rw-r--r--main/busybox/0001-ifupdown-support-metric-for-static-default-gw.patch64
-rw-r--r--main/busybox/APKBUILD4
2 files changed, 67 insertions, 1 deletions
diff --git a/main/busybox/0001-ifupdown-support-metric-for-static-default-gw.patch b/main/busybox/0001-ifupdown-support-metric-for-static-default-gw.patch
new file mode 100644
index 000000000..75e6ba7ce
--- /dev/null
+++ b/main/busybox/0001-ifupdown-support-metric-for-static-default-gw.patch
@@ -0,0 +1,64 @@
+From cfcb1dac83c9e18a06a07f0b212f6701bb87c2ad Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Fri, 17 Feb 2012 19:36:26 +0000
+Subject: [PATCH] ifupdown: support metric for static default gw
+
+This is useful when you have multiple ISPs with failover. It allows
+setting the priority of the static gateway and makes it possible
+to specify multiple static gateways.
+
+The ubuntu ifupdown supports it.
+
+function old new delta
+.rodata 116725 116797 +72
+------------------------------------------------------------------------------
+(add/remove: 0/0 grow/shrink: 1/0 up/down: 72/0) Total: 72 bytes
+ text data bss dec hex filename
+ 953343 7313 8984 969640 ecba8 busybox_old
+ 953415 7313 8984 969712 ecbf0 busybox_unstripped
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ networking/ifupdown.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/networking/ifupdown.c b/networking/ifupdown.c
+index 73da260..dfda206 100644
+--- a/networking/ifupdown.c
++++ b/networking/ifupdown.c
+@@ -403,11 +403,11 @@ static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec)
+ result = execute("ip addr add %address%/%netmask% dev %iface%[[ label %label%]]", ifd, exec);
+ result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec);
+ /* Was: "[[ ip ....%gateway% ]]". Removed extra spaces w/o checking */
+- result += execute("[[ip route add ::/0 via %gateway%]]", ifd, exec);
++ result += execute("[[ip route add ::/0 via %gateway%]][[ prio %metric%]]", ifd, exec);
+ # else
+ result = execute("ifconfig %iface%[[ media %media%]][[ hw %hwaddress%]][[ mtu %mtu%]] up", ifd, exec);
+ result += execute("ifconfig %iface% add %address%/%netmask%", ifd, exec);
+- result += execute("[[route -A inet6 add ::/0 gw %gateway%]]", ifd, exec);
++ result += execute("[[route -A inet6 add ::/0 gw %gateway%[[ metric %metric%]]]]", ifd, exec);
+ # endif
+ return ((result == 3) ? 3 : 0);
+ }
+@@ -490,7 +490,7 @@ static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec)
+ result = execute("ip addr add %address%/%bnmask%[[ broadcast %broadcast%]] "
+ "dev %iface%[[ peer %pointopoint%]][[ label %label%]]", ifd, exec);
+ result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec);
+- result += execute("[[ip route add default via %gateway% dev %iface%]]", ifd, exec);
++ result += execute("[[ip route add default via %gateway% dev %iface%[[ prio %metric%]]]]", ifd, exec);
+ return ((result == 3) ? 3 : 0);
+ # else
+ /* ifconfig said to set iface up before it processes hw %hwaddress%,
+@@ -500,7 +500,7 @@ static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec)
+ result += execute("ifconfig %iface% %address% netmask %netmask%"
+ "[[ broadcast %broadcast%]][[ pointopoint %pointopoint%]] ",
+ ifd, exec);
+- result += execute("[[route add default gw %gateway% %iface%]]", ifd, exec);
++ result += execute("[[route add default gw %gateway%[[ metric %metric%]] %iface%]]", ifd, exec);
+ return ((result == 3) ? 3 : 0);
+ # endif
+ }
+--
+1.7.10.1
+
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index 0cf32cb3b..92f5d71e0 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
pkgver=1.19.4
-pkgrel=3
+pkgrel=4
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net
arch="all"
@@ -24,6 +24,7 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
0001-grep-support-for-x-match-whole-line.patch
0001-tar-Implement-no-recursion.patch
0001-unzip-ignore-chmod-errors-so-unzipping-on-FAT-works.patch
+ 0001-ifupdown-support-metric-for-static-default-gw.patch
busyboxconfig"
@@ -98,4 +99,5 @@ cfafb917f777437f428ea97da0a63915 0001-acpid-do-not-install-handlers-for-fatal-s
699701047d05468a13e5c37b5ebc3824 0001-grep-support-for-x-match-whole-line.patch
b0977368029587bab23067f0267ae309 0001-tar-Implement-no-recursion.patch
d13491d62d8987f79c385f6fdd94836a 0001-unzip-ignore-chmod-errors-so-unzipping-on-FAT-works.patch
+ce7fcd5eee5b0e9bf67108b241c09ea2 0001-ifupdown-support-metric-for-static-default-gw.patch
42e2f49483e650193c0e142ade7de142 busyboxconfig"