diff options
author | Avneesh Sachdev <avneesh@opensourcerouting.org> | 2012-04-09 00:25:15 -0700 |
---|---|---|
committer | Avneesh Sachdev <avneesh@opensourcerouting.org> | 2012-04-09 00:25:15 -0700 |
commit | 3cf6c2b4e43f44a977d218c96c26250654ae333e (patch) | |
tree | e017cde2015fbf3ef6c250327428d7c6152aa8f7 /zebra/redistribute.c | |
parent | 01d7ff0a2166a422c56bd26f04fc22832a9e690b (diff) | |
parent | e96b312150d8e376c1ef463793d1929eca3618d5 (diff) |
Merge branch 'quagga' into google-bgp-multipath
Conflicts:
bgpd/bgp_route.c
Diffstat (limited to 'zebra/redistribute.c')
-rw-r--r-- | zebra/redistribute.c | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/zebra/redistribute.c b/zebra/redistribute.c index a8107aeb..4276f1d0 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -245,26 +245,15 @@ zebra_redistribute_add (int command, struct zserv *client, int length) type = stream_getc (client->ibuf); - switch (type) + if (type == 0 || type >= ZEBRA_ROUTE_MAX) + return; + + if (! client->redist[type]) { - case ZEBRA_ROUTE_KERNEL: - case ZEBRA_ROUTE_CONNECT: - case ZEBRA_ROUTE_STATIC: - case ZEBRA_ROUTE_RIP: - case ZEBRA_ROUTE_RIPNG: - case ZEBRA_ROUTE_OSPF: - case ZEBRA_ROUTE_OSPF6: - case ZEBRA_ROUTE_BGP: - if (! client->redist[type]) - { - client->redist[type] = 1; - zebra_redistribute (client, type); - } - break; - default: - break; + client->redist[type] = 1; + zebra_redistribute (client, type); } -} +} void zebra_redistribute_delete (int command, struct zserv *client, int length) @@ -273,22 +262,11 @@ zebra_redistribute_delete (int command, struct zserv *client, int length) type = stream_getc (client->ibuf); - switch (type) - { - case ZEBRA_ROUTE_KERNEL: - case ZEBRA_ROUTE_CONNECT: - case ZEBRA_ROUTE_STATIC: - case ZEBRA_ROUTE_RIP: - case ZEBRA_ROUTE_RIPNG: - case ZEBRA_ROUTE_OSPF: - case ZEBRA_ROUTE_OSPF6: - case ZEBRA_ROUTE_BGP: - client->redist[type] = 0; - break; - default: - break; - } -} + if (type == 0 || type >= ZEBRA_ROUTE_MAX) + return; + + client->redist[type] = 0; +} void zebra_redistribute_default_add (int command, struct zserv *client, int length) |