2014-08-05 17:24:31 +02:00
|
|
|
From fc03504435d8bf5d0a31b8c566c2e783fbb96ec6 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Hannes Reinecke <hare@suse.de>
|
|
|
|
Date: Wed, 30 Jul 2014 10:28:27 +0200
|
|
|
|
Subject: 40network: handle prefixed IP addresses correctly
|
|
|
|
|
|
|
|
If an IP address is given with prefix length ifup should be
|
|
|
|
parsing that correctly. And we should assume a prefix length
|
|
|
|
of /64 for IPv6 resp /24 for IPv4 if none were given.
|
|
|
|
|
|
|
|
References: bnc#880108
|
|
|
|
|
|
|
|
Signed-off-by: Hannes Reinecke <hare@suse.de>
|
|
|
|
---
|
|
|
|
modules.d/40network/ifup.sh | 8 ++++++++
|
|
|
|
1 file changed, 8 insertions(+)
|
|
|
|
|
2015-06-30 14:59:59 +02:00
|
|
|
Index: dracut-042/modules.d/40network/ifup.sh
|
2015-03-31 16:12:12 +02:00
|
|
|
===================================================================
|
2015-06-30 14:59:59 +02:00
|
|
|
--- dracut-042.orig/modules.d/40network/ifup.sh 2015-06-24 18:02:23.090153581 +0200
|
|
|
|
+++ dracut-042/modules.d/40network/ifup.sh 2015-06-24 18:02:27.658413647 +0200
|
|
|
|
@@ -223,11 +223,19 @@ do_static() {
|
2014-08-05 17:24:31 +02:00
|
|
|
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
|
|
|
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
|
|
|
[ -n "$mask" -a -z "$prefix" ] && prefix=$(mask_to_prefix $mask)
|
|
|
|
+ if [ "${ip##*/}" != "${ip}" ] ; then
|
|
|
|
+ prefix="${ip##*/}"
|
|
|
|
+ ip="${ip%/*}"
|
|
|
|
+ fi
|
|
|
|
if strglobin $ip '*:*:*'; then
|
|
|
|
+ # Always assume /64 prefix for IPv6
|
|
|
|
+ [ -z "$prefix" ] && prefix=64
|
|
|
|
# note no ip addr flush for ipv6
|
|
|
|
ip addr add $ip/$prefix ${srv:+peer $srv} dev $netif
|
|
|
|
wait_for_ipv6_dad $netif
|
|
|
|
else
|
|
|
|
+ # Assume /24 prefix for IPv4
|
|
|
|
+ [ -z "$prefix" ] && prefix=24
|
|
|
|
ip addr flush dev $netif
|
|
|
|
ip addr add $ip/$prefix ${srv:+peer $srv} brd + dev $netif
|
|
|
|
fi
|