]> git.proxmox.com Git - mirror_frr.git/commit
lib,zebra: do not enable link-params when a link-params command fails
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 14 Oct 2022 15:57:17 +0000 (17:57 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Mon, 17 Oct 2022 09:02:56 +0000 (11:02 +0200)
commit2e2dc4f024312b7351b3d7e964fed42895fd123e
tree8bb5893fb45a61f42b7e34460703aeaaaa7b7a96
parentfd30c2467a9a3afc615923af64f5de91937d268f
lib,zebra: do not enable link-params when a link-params command fails

A given interface has no enabled link-params context. If a link-params
configuration command fails, the link-params is wrongly enabled:

> r4(config-link-params)# no enable
> r4(config-link-params)# delay
>   (0-16777215)  Average delay in micro-second as decimal (0...16777215)
> r4(config-link-params)# delay 50 min 300 max 500
> Average delay should be comprise between Min (300) and Max (500) delay
> r4(config-link-params)# do sh run zebra
> (...)
> interface eth-rt1
> link-params
>  enable
> exit-link-params

link-params are enabled if and only if the interface structure has a
valid link_params pointer. Before checking the command validity,
if_link_params_get() is called to retrieve the link-params pointer.
However, this function initializes the pointer if it is NULL.

Only use if_link_params_get() to retrieve the pointer to avoid
confusion. In command setting functions, initialize the link_params
pointer if needed only after the validation of the command.

Fixes: 16f1b9e ("Update Traffic Engineering Support for OSPFD")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
lib/if.c
lib/if.h
zebra/interface.c