summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorpaul <paul>2003-05-25 21:35:06 +0000
committerpaul <paul>2003-05-25 21:35:06 +0000
commit595db7f16506d2c82a3478e9f8dab00c8733d386 (patch)
tree240d477dd4b5262ba78cc50fda4b81de09e2c91c /lib/zclient.c
parent726f9b2bbdd5a607f7b0a10a64547739b807e361 (diff)
Add back support for null0 interface blackhole routes.
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index ebf685a0..bb7747fa 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -317,18 +317,24 @@ zapi_ipv4_add (struct zclient *zclient, struct prefix_ipv4 *p,
/* Nexthop, ifindex, distance and metric information. */
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_NEXTHOP))
{
- stream_putc (s, api->nexthop_num + api->ifindex_num);
-
+ if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE))
+ {
+ stream_putc (s, 1);
+ stream_putc (s, ZEBRA_NEXTHOP_BLACKHOLE);
+ }
+ else
+ stream_putc (s, api->nexthop_num + api->ifindex_num);
+
for (i = 0; i < api->nexthop_num; i++)
- {
- stream_putc (s, ZEBRA_NEXTHOP_IPV4);
- stream_put_in_addr (s, api->nexthop[i]);
- }
+ {
+ stream_putc (s, ZEBRA_NEXTHOP_IPV4);
+ stream_put_in_addr (s, api->nexthop[i]);
+ }
for (i = 0; i < api->ifindex_num; i++)
- {
- stream_putc (s, ZEBRA_NEXTHOP_IFINDEX);
- stream_putl (s, api->ifindex[i]);
- }
+ {
+ stream_putc (s, ZEBRA_NEXTHOP_IFINDEX);
+ stream_putl (s, api->ifindex[i]);
+ }
}
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_DISTANCE))
@@ -371,18 +377,24 @@ zapi_ipv4_delete (struct zclient *zclient, struct prefix_ipv4 *p,
/* Nexthop, ifindex, distance and metric information. */
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_NEXTHOP))
{
- stream_putc (s, api->nexthop_num + api->ifindex_num);
+ if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE))
+ {
+ stream_putc (s, 1);
+ stream_putc (s, ZEBRA_NEXTHOP_BLACKHOLE);
+ }
+ else
+ stream_putc (s, api->nexthop_num + api->ifindex_num);
for (i = 0; i < api->nexthop_num; i++)
- {
- stream_putc (s, ZEBRA_NEXTHOP_IPV4);
- stream_put_in_addr (s, api->nexthop[i]);
- }
+ {
+ stream_putc (s, ZEBRA_NEXTHOP_IPV4);
+ stream_put_in_addr (s, api->nexthop[i]);
+ }
for (i = 0; i < api->ifindex_num; i++)
- {
- stream_putc (s, ZEBRA_NEXTHOP_IFINDEX);
- stream_putl (s, api->ifindex[i]);
- }
+ {
+ stream_putc (s, ZEBRA_NEXTHOP_IFINDEX);
+ stream_putl (s, api->ifindex[i]);
+ }
}
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_DISTANCE))