Route attributes overwritten during reconfiguration

Ondrej Zajicek santiago at crfreenet.org
Fri Feb 17 14:22:11 CET 2017


On Fri, Feb 17, 2017 at 09:06:55AM +0200, Lennert Buytenhek wrote:
> Hello!
> 
> I work with João and I managed to cut our (huge) config down to a
> minimal reproducer.  Our setup does something like this:

Hi

Thanks for trying to track the problem.


> There seems to be a problem related to the memory management of
> strings used in per static route implicit filter expressions when a
> reconfiguration happens.

Does the problem disappear if you replace strings with numbers in your test case?


> 
> The crash goes away if I apply this patch (not the right fix, I'm sure):
> 
> ===
> diff --git a/proto/static/static.c b/proto/static/static.c
> index 0c088cd..a56771f 100644
> --- a/proto/static/static.c
> +++ b/proto/static/static.c
> @@ -498,7 +498,8 @@ static_same_dest(struct static_route *x, struct static_route *y)
>  static inline int
>  static_same_rte(struct static_route *x, struct static_route *y)
>  {
> -  return static_same_dest(x, y) && i_same(x->cmds, y->cmds);
> +//  return static_same_dest(x, y) && i_same(x->cmds, y->cmds);
> +  return 0;
>  }
>  
>  
> ===
> 
> I think that the reconfiguration code finds the old and the new implicit
> filter expression to be the same code, and therefore hangs onto the old
> version, but then the underlying memory for some of the old objects gets
> freed.  Or something like that.

Well, the comparison in static_same_rte() is just for decision whether
the route should be propagated again to the (main) routing table.

Internal structures of static protocols (like struct static_route) are
replaced anyways.


-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20170217/eff5ac24/attachment.asc>


More information about the Bird-users mailing list