From ad875010c7eb7bae577536fd38bfc21b54b3108b Mon Sep 17 00:00:00 2001 From: Stephen Soltesz Date: Thu, 6 Aug 2009 15:44:59 +0000 Subject: [PATCH] make bwlimit None if it is not set to a value. Previously, an empty value would translate into zero. This caused NM to enforce a zero bwlimit on the node, which caused node to act very very slowly. --- planetlab/common/actions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/planetlab/common/actions.php b/planetlab/common/actions.php index 5649a8c..6b78666 100644 --- a/planetlab/common/actions.php +++ b/planetlab/common/actions.php @@ -418,7 +418,11 @@ switch ($action) { foreach ($interface_details as $field) { $interface[$field]= $_POST[$field]; if( in_array( $field, array( 'bwlimit', 'node_id' ) ) ) { - $interface[$field]= intval( $interface[$field] ); + if ( intval($interface[$field]) != 0 ) { + $interface[$field]= intval( $interface[$field]); + } elseif ($field=='bwlimit' ) { + $interface[$field] = NULL; + } } } $result=$api->UpdateInterface( intval( $interface_id ), $interface ); -- 2.43.0