summaryrefslogtreecommitdiffstats
path: root/zebra/rt_socket.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 18:11:12 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 18:11:12 +0200
commit6ae24471cb3ca237a8e479f9c39557601c2cc2f2 (patch)
tree584d27079771cd854e267b4367613e47f6d8df4a /zebra/rt_socket.c
parentZebra: Optimize static route path deletion. (diff)
downloadfrr-6ae24471cb3ca237a8e479f9c39557601c2cc2f2.tar.xz
frr-6ae24471cb3ca237a8e479f9c39557601c2cc2f2.zip
Zebra: Implement route replace semantics.
Zebra currently performs a delete followed by add when a route needs to be modified. Change this to use the replace semantics of netlink so that the operation can possibly be atomic. Note: Only implemented for IPv4 currently.
Diffstat (limited to 'zebra/rt_socket.c')
-rw-r--r--zebra/rt_socket.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index 90ed73d0b..c36677510 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -231,6 +231,13 @@ kernel_add_ipv4 (struct prefix *p, struct rib *rib)
}
int
+kernel_update_ipv4 (struct prefix *p, struct rib *rib)
+{
+ kernel_delete_ipv4 (p, rib);
+ return kernel_add_ipv4 (p, rib);
+}
+
+int
kernel_delete_ipv4 (struct prefix *p, struct rib *rib)
{
int route;