Commit 315973de by Juliusz Chroboczek

Send updates from check_xroutes.

This ensures that retractions are sent too.
1 parent 5f256663
......@@ -503,7 +503,7 @@ main(int argc, char **argv)
if(receive_buffer == NULL)
goto fail;
}
check_xroutes();
check_xroutes(0);
kernel_routes_changed = 0;
kernel_link_changed = 0;
kernel_addr_changed = 0;
......@@ -617,10 +617,8 @@ main(int argc, char **argv)
if(kernel_routes_changed || kernel_addr_changed ||
now.tv_sec >= kernel_dump_time) {
rc = check_xroutes();
if(rc > 0)
send_self_update(NULL, 1);
else if(rc < 0)
rc = check_xroutes(1);
if(rc < 0)
fprintf(stderr, "Warning: couldn't check exported routes.\n");
kernel_routes_changed = kernel_addr_changed = 0;
if(kernel_socket >= 0)
......
......@@ -99,7 +99,7 @@ add_xroute(int kind, unsigned char prefix[16], unsigned char plen,
}
int
check_xroutes()
check_xroutes(int send_updates)
{
int i, j, metric, export, change = 0, rc;
struct kernel_route routes[240];
......@@ -159,6 +159,8 @@ check_xroutes()
if(!export) {
flush_xroute(&xroutes[i]);
if(send_updates)
send_update(NULL, 1, xroutes[i].prefix, xroutes[i].plen);
change = 1;
} else {
i++;
......@@ -180,6 +182,8 @@ check_xroutes()
metric, routes[i].ifindex, routes[i].proto);
if(rc)
change = 1;
if(send_updates)
send_update(NULL, 1, xroutes[i].prefix, xroutes[i].plen);
}
}
return change;
......
......@@ -20,8 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
int check_xroutes(void);
/* These should come in decreasing order of priority. */
#define XROUTE_FORCED 1
......@@ -42,4 +40,4 @@ extern int numxroutes;
struct xroute *find_xroute(const unsigned char *prefix, unsigned char plen);
int add_xroute(int kind, unsigned char prefix[16], unsigned char plen,
unsigned short metric, unsigned int ifindex, int proto);
int check_xroutes(void);
int check_xroutes(int send_updates);
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!