mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
Fixes bug related to reconfiguration of BGP.
BGP keeps its copy of configuration ptr and didn't update it during reconfiguration. But old configuration is freed during reconfiguration. That leads to unnecessary reset of BGP connection during reconfiguration (old conf is corrupted and therefore different) and possibly other strange behavior.
This commit is contained in:
parent
11b32d9117
commit
591211557f
@ -876,9 +876,15 @@ bgp_reconfigure(struct proto *P, struct proto_config *C)
|
|||||||
struct bgp_proto *p = (struct bgp_proto *) P;
|
struct bgp_proto *p = (struct bgp_proto *) P;
|
||||||
struct bgp_config *old = p->cf;
|
struct bgp_config *old = p->cf;
|
||||||
|
|
||||||
return !memcmp(((byte *) old) + sizeof(struct proto_config),
|
int same = !memcmp(((byte *) old) + sizeof(struct proto_config),
|
||||||
((byte *) new) + sizeof(struct proto_config),
|
((byte *) new) + sizeof(struct proto_config),
|
||||||
sizeof(struct bgp_config) - sizeof(struct proto_config));
|
sizeof(struct bgp_config) - sizeof(struct proto_config));
|
||||||
|
|
||||||
|
/* We should update our copy of configuration ptr as old configuration will be freed */
|
||||||
|
if (same)
|
||||||
|
p->cf = new;
|
||||||
|
|
||||||
|
return same;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct protocol proto_bgp = {
|
struct protocol proto_bgp = {
|
||||||
|
Loading…
Reference in New Issue
Block a user