]> git.proxmox.com Git - mirror_frr.git/commit - zebra/zapi_msg.c
zebra: Make rnh only send response once on first registration
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 4 Apr 2019 12:45:20 +0000 (08:45 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 4 Apr 2019 12:45:20 +0000 (08:45 -0400)
commitdd25a6b3a33102aa20fd9b735f76071aed7c3802
treeb21a396e6c0a11e1fc89554967241f242ff5f805
parent59d11e7cd197e5902b632d0f8ca6e523ed50489a
zebra: Make rnh only send response once on first registration

The current code path of registration does this:

a) Lookup or create the rnh
b) register the client with the rnh for callback
   If this is a new rnh send a response to the client that
   only includes the rnh data that it has (nothing so no path)
   If this is a existing rnh send the actual path to the client,
     if it exists.
c) If a new client or a flag has changed refigure and send result
   to all clients.

This is problematic in that suppose the rnh is new.  Clients
will receive two answers:
  1) A call back with no nexthops
  2) A call back with the resolved # of nexthops

Imagine pim who depends on nht to handle this, pim will create
a mroute( because it does a hard lookup of the rpf as it is registering
the nexthop ), then it will receive the first callback causing
it to tear down the mroute and then receive the second callback
causing it to put it right back.. This is obviously not very
good for mroutes.

This code moves the send to the new client till after the new
client has connected, thus only allowing one callback to the new
client with the actual answer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zapi_msg.c