Commit c3892665 authored by Rostyslav Fridman's avatar Rostyslav Fridman Committed by Natanael Copa

main/busybox-initscripts: fix udhcpc script to assign IP addresses with /32 netmask

parent b0417868
......@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox-initscripts
pkgver=3.1
pkgrel=3
pkgrel=4
pkgdesc="Init scripts for busybox daemons"
url="https://git.alpinelinux.org/cgit/aports/tree/core/busybox-initscripts"
arch="noarch"
......@@ -78,4 +78,4 @@ ebd82f935da2ca89097234dd8a8f47e179a423652c151123a1f3343f3e1e7bfaba2b8800380e988d
b2dcf0ded9264334d79fbbb05dd12d649dc3119a060db5893f0e8aeca2141323961c3ba4c822a0ffb00dba848742d5cb374dc77e776b57cecde352a3e8e30f8a usbdev
392c40d223bdff59a624bd67907c06cff9c1b5468c25c19e10dbc3cef3208275d93966e760f140d71a86cb36ec796ea08dbaa767b40c12e9326c3c72964b28a8 usbdisk_link
5db6fa8bbb2d891212187c598cd8703277b3fcb95b5dba6628f7128eb48cc7c1bf4c53885e9d870999c8c95d2fe9cd27609b523596dc553c31b6f72a452a0118 xvd_links
e260283c154169b62e1ce975b0e1fd7708e3e7daf27afc9a9f6d121331eb7f1607a6b6babb29237bacd30668505930929fdae31db760828e1758269e08ad7223 default.script"
788e3525af419dadff5a46f672b9356a1d9f8a3360523e8e247b926a67180212a002adb2499293d3455cce67a95ed8e2c27f9327ae1a5271f6e7f320dc1c2b98 default.script"
......@@ -67,6 +67,13 @@ routes() {
done
num=0
for gw in $router; do
if [ "$subnet" = "255.255.255.255" ]; then
# special case for /32 subnets:
# /32 instructs kernel to always use routing for all outgoing packets
# (they can never be sent to local subnet - there is no local subnet for /32).
# Used in datacenters, avoids the need for private ip-addresses between two hops.
ip -4 route add $gw dev $interface
fi
ip -4 route add 0.0.0.0/0 via $gw dev $interface \
metric $(( $num + ${IF_METRIC:-$(calc_metric)} ))
num=$(( $num + 1 ))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment