summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share/media/ftp.subr
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-06-02 23:18:27 +0000
committerdteske <dteske@FreeBSD.org>2013-06-02 23:18:27 +0000
commit2d62c22a993847496b374145be7924d05cc273ae (patch)
tree07610eeadac9d6616da4acf5b72a2db562cc1f90 /usr.sbin/bsdconfig/share/media/ftp.subr
parent0d6301c0f948d2645f6a1a1b2771eb17753e99f2 (diff)
downloadFreeBSD-src-2d62c22a993847496b374145be7924d05cc273ae.zip
FreeBSD-src-2d62c22a993847496b374145be7924d05cc273ae.tar.gz
Fix a bug that would cause a spurious warning to appear to appear in an
edge-case. The case was that you have been through the FTP setup once before and on the second time through, you cancel at the re-selection of a new FTP server. The spurious warning was "device_media: not found" and was caused because the underlying call to f_device_network_down() did not check to see if the network device existed before attempting to shut it down. Add checks to make sure we don't forge ahead unless the device exists.
Diffstat (limited to 'usr.sbin/bsdconfig/share/media/ftp.subr')
-rw-r--r--usr.sbin/bsdconfig/share/media/ftp.subr2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/bsdconfig/share/media/ftp.subr b/usr.sbin/bsdconfig/share/media/ftp.subr
index e6cea0f..1ae157d 100644
--- a/usr.sbin/bsdconfig/share/media/ftp.subr
+++ b/usr.sbin/bsdconfig/share/media/ftp.subr
@@ -502,6 +502,7 @@ f_media_set_ftp_userpass()
f_device_network_up()
{
local dev="$1" netDev
+ f_struct device_$dev || return $FAILURE
device_$dev get private netDev || return $SUCCESS # No net == happy net
f_device_init $netDev
}
@@ -513,6 +514,7 @@ f_device_network_up()
f_device_network_down()
{
local dev="$1" netDev
+ f_struct device_$dev || return $FAILURE
device_$dev get private netDev || return $SUCCESS
f_device_shutdown $netDev
}
OpenPOWER on IntegriCloud