Skip to content

Commit 8c4a6b3

Browse files
committed
bandwidth: handle nil bandwidth in CHECK
Somehow we missed this case; if CHECK is called with no bandwidth configuration, we segfault. Oops. Fixes: #1221 Signed-off-by: Casey Callendrello <[email protected]>
1 parent 9b3772e commit 8c4a6b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/meta/bandwidth/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ func cmdCheck(args *skel.CmdArgs) error {
299299

300300
bandwidth := getBandwidth(bwConf)
301301

302+
// No bandwidth config; nothing to do.
303+
if bandwidth == nil || bandwidth.isZero() {
304+
return nil
305+
}
306+
302307
if bandwidth.IngressRate > 0 && bandwidth.IngressBurst > 0 {
303308
rateInBytes := bandwidth.IngressRate / 8
304309
burstInBytes := bandwidth.IngressBurst / 8

0 commit comments

Comments
 (0)