File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,11 @@ class EcnConfig(object):
106
106
def set_wred_threshold (self , profile , threshold , value ):
107
107
if os .geteuid () != 0 :
108
108
sys .exit ("Root privileges required for this operation" )
109
+
110
+ v = int (value )
111
+ if v < 0 :
112
+ raise Exception ("Invalid %s" % (threshold ))
113
+
109
114
field = WRED_CONFIG_FIELDS [threshold ]
110
115
if self .verbose :
111
116
print ("Setting %s value to %s" % (field , value ))
@@ -114,6 +119,11 @@ class EcnConfig(object):
114
119
def set_wred_prob (self , profile , drop_color , value ):
115
120
if os .geteuid () != 0 :
116
121
sys .exit ("Root privileges required for this operation" )
122
+
123
+ v = int (value )
124
+ if v < 0 or v > 100 :
125
+ raise Exception ("Invalid %s" % (drop_color ))
126
+
117
127
field = WRED_CONFIG_FIELDS [drop_color ]
118
128
if self .verbose :
119
129
print ("Setting %s value to %s%%" % (field , value ))
You can’t perform that action at this time.
0 commit comments