From 4589f5a558cb0f56321a1170bba5df30010fb6f0 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 24 May 2012 20:35:03 +0000 Subject: [PATCH] Fix -g being specified even without a gateway git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12930 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/slpdiscover.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/slpdiscover.pm b/xCAT-server/lib/xcat/plugins/slpdiscover.pm index ee584141c..3cbbc5b99 100644 --- a/xCAT-server/lib/xcat/plugins/slpdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/slpdiscover.pm @@ -203,7 +203,9 @@ sub setupIMM { $ssh->cmd("ifconfig eth0 -ipv6static enable -i6 $ip"); } else { (my $sip,my $mask,my $gw) = xCAT_plugin::bmcconfig::net_parms($ip); - $ssh->cmd("ifconfig eth0 -c static -i $ip -s $mask -g $gw"); + my $cmd = "ifconfig eth0 -c static -i $ip -s $mask"; + if ($gw) { $cmd .= "-g $gw"; } + $ssh->cmd($cmd); } } $ssh->close();