bond: improve the validation for setting peer_notif_delay

Synchronize with NM, the default value of peer_notif_delay in NM is 0,
which is not considered as enabling the setting or specifying the
delay.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
Wen Liang 2022-10-06 14:47:25 -04:00 committed by Fernando Fernández Mancera
parent cfbd14cd8a
commit 90a8ea5051

View file

@ -1494,7 +1494,7 @@ class ArgValidator_DictBond(ArgValidatorDict):
name,
"the bond option downdelay or updelay is only valid with miimon enabled",
)
if result["peer_notif_delay"] is not None:
if result["peer_notif_delay"]:
if not result["miimon"] or result["peer_notif_delay"] % result["miimon"]:
raise ValidationError(
name,