From: Oliver Kurth Date: Wed, 7 Jun 2017 00:17:04 +0000 (-0700) Subject: FreeBSD: Use the "dhclient" command to renew a DHCP IP address. X-Git-Tag: stable-10.1.10~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2df92fb9e1791608d009988e3ce014f23b869a0;p=thirdparty%2Fopen-vm-tools.git FreeBSD: Use the "dhclient" command to renew a DHCP IP address. On FreeBSD, "/etc/rc.d/netif" is sufficient to stop a network interface when suspending a VM. When resuming a VM, DHCP configured interfaces must be restarted with "/etc/rc.d/dhclient". This fix is courtesy of Steve Wills, maintainer of open-vm-tools on FreeBSD, and Shuai Wang. Pull request: https://github.com/vmware/open-vm-tools/pull/142 --- diff --git a/open-vm-tools/scripts/freebsd/network b/open-vm-tools/scripts/freebsd/network index 47a98fd66..0c7052617 100644 --- a/open-vm-tools/scripts/freebsd/network +++ b/open-vm-tools/scripts/freebsd/network @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2010-2016 VMware, Inc. All rights reserved. +# Copyright (C) 2010-2017 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -59,6 +59,7 @@ ToggleNetwork() { for intf in `list_net_interfaces dhcp`; do /etc/rc.d/netif $1 $intf + /etc/rc.d/dhclient $1 $intf ec=$? # Failure to stop an interface should not interfere with suspend. @@ -85,7 +86,9 @@ main() { [ -r /etc/rc.subr ] || Panic "Cannot read /etc/rc.subr." [ -r /etc/network.subr ] || Panic "Cannot read /etc/network.subr" - [ -x /etc/rc.d/netif ] || Panic "Cannot read /etc/rc.d/netif" + [ -x /etc/rc.d/netif ] || Panic "Cannot find an executable /etc/rc.d/netif" + [ -x /etc/rc.d/dhclient ] || \ + Panic "Cannot find an executable /etc/rc.d/dhclient" case "$1" in suspend-vm)