dracut/0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch
Thomas Renninger 7bf826553e Accepting request 251837 from home:trenn:branches:Base:System
- Add ip= and root=nfs.. to dracut internal cmdline to make nfsroot working
  (bnc#896464)
* Add 0160-nfs-Add-ip-.-and-root-nfs.-parameters-to-internal-dr.patch
- Fix error message in case there is no internal dracut cmdline added
  Simple fix
* Add 0161-Fix-error-message-when-there-are-no-internal-kernel-.patch
- Request DHCP lease instead of getting/applying the offer
  No bug number, but Pawel rated this high prio. This should hit SLE12 still.
* Add 0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch

OBS-URL: https://build.opensuse.org/request/show/251837
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=191
2014-09-24 16:28:44 +00:00

73 lines
2.2 KiB
Diff

From b4216546ff3254f2ca21c6b29c745e1bfd4956cc Mon Sep 17 00:00:00 2001
From: Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
Date: Wed, 24 Sep 2014 18:14:37 +0200
Subject: network: Request DHCP lease instead of getting/applying the offer
- Request ipv6 lease in proper mode: auto when auto6+dhcp6 requested
otherwise managed mode
- wait for DAD results in case of ipv6
Signed-off-by: Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
---
modules.d/40network/ifup.sh | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index 5cd4f68..1ff1a4a 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -182,9 +182,15 @@ do_dhcp() {
local dhclient=''
if [ "$1" = "-6" ] ; then
- dhclient="wickedd-dhcp6"
+ local ipv6_mode=''
+ if [ -f /tmp/net.$netif.auto6 ] ; then
+ ipv6_mode="auto"
+ else
+ ipv6_mode="managed"
+ fi
+ dhclient="wickedd-dhcp6 --test --test-mode $ipv6_mode"
else
- dhclient="wickedd-dhcp4"
+ dhclient="wickedd-dhcp4 --test"
fi
if ! iface_has_link $netif; then
@@ -198,10 +204,14 @@ do_dhcp() {
fi
echo "Starting dhcp for interface $netif"
- $dhclient --test $netif > /tmp/leaseinfo.${netif}.dhcp.ipv${1:1:1}
+ $dhclient --test-format leaseinfo --test-output /tmp/leaseinfo.${netif}.dhcp.ipv${1:1:1} --test-request - $netif << EOF
+<request type="lease"/>
+EOF
dhcp_apply $1 || return $?
+ if [ "$1" = "-6" ] ; then
+ wait_for_ipv6_dad $netif
+ fi
- echo $netif > /tmp/setup_net_${netif}.ok
return 0
}
@@ -220,6 +230,7 @@ do_ipv6auto() {
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
+ echo 1 > /proc/sys/net/ipv6/conf/$netif/autoconf
linkup $netif
wait_for_ipv6_auto $netif
@@ -492,6 +503,7 @@ for p in $(getargs ip=); do
load_ipv6
do_dhcp -6 ;;
auto6)
+ echo $netif > /tmp/net.$netif.auto6
do_ipv6auto ;;
static)
do_ifcfg ;;
--
1.7.6.1