diff options
author | David Lamparter <equinox@diac24.net> | 2009-08-27 00:27:40 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-03 05:18:41 +0100 |
commit | 443e75977a1acb839f12adbbe6164e5d21114a66 (patch) | |
tree | 36ab46e8133e5db438026931d4fc092db2dd718f | |
parent | 8fcd030de867a3ca6eddf47753e3bac106a1b1e4 (diff) | |
download | quagga-443e75977a1acb839f12adbbe6164e5d21114a66.tar.bz2 quagga-443e75977a1acb839f12adbbe6164e5d21114a66.tar.xz |
zebra: fix redistribution of new protocols
redistribute is currently limited to "known" protocols. there is no
reason for this limitation, so, remove it.
-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) |