]> git.puffer.fish Git - mirror/frr.git/commit
lib,zebra: link-params are not flushed after no enable 12125/head
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 14 Oct 2022 15:57:20 +0000 (17:57 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Mon, 17 Oct 2022 10:21:27 +0000 (12:21 +0200)
commitfe0a129687c530d95377a6ed7c14d578c5be5996
tree64a9164f8a2a3dc5f23721a4443cb14b21ce4bff
parent2e2dc4f024312b7351b3d7e964fed42895fd123e
lib,zebra: link-params are not flushed after no enable

Daemons like isisd continue to use the previous link-params after they
are removed from zebra.

For example,
>r0# sh run zebra
> (...)
> interface eth-rt1
>  link-params
>   enable
>   metric 100
>  exit-link-params
> r0# conf
> r0(config)# interface eth-rt1
> r0(config-if)#  link-params
> r0(config-link-params)#   no enable

After "no enable", "sh run zebra" displays no more link-params context.

The "no enable" causes the release of the "link_params" pointer within
the "interface" structure. The zebra function to update daemons with
a ZEBRA_INTERFACE_LINK_PARAMS zapi message is called but the function
returns without doing anything because the "link_params" pointer is
NULL. Therefore, the "link_params" pointers are kept in daemons.

When the zebra "link_params" pointer is NULL:

- Send a zapi link param message that contains no link parameters
  instead of sending no message.
- At reception in daemons, the absence of link parameters causes the
  release of the "link_params" pointer.

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