Browse Source

fix zebra protocol after MP-BGP changes

The previous commits modified both zebra and bgpd for additional
SAFI field, but not any other routing daemon, which led to zebra
daemon crashing with failed assertion.
Denis Ovsienko 8 years ago
parent
commit
b4e45f6705
5 changed files with 14 additions and 0 deletions
  1. 5 0
      isisd/isis_zebra.c
  2. 1 0
      ospf6d/ospf6_zebra.c
  3. 4 0
      ospfd/ospf_zebra.c
  4. 2 0
      ripd/rip_zebra.c
  5. 2 0
      ripngd/ripng_zebra.c

+ 5 - 0
isisd/isis_zebra.c

@@ -274,6 +274,8 @@ isis_zebra_route_add_ipv4 (struct prefix *prefix,
       stream_putc (stream, flags);
       /* message */
       stream_putc (stream, message);
+      /* SAFI */
+      stream_putw (stream, SAFI_UNICAST);
       /* prefix information */
       psize = PSIZE (prefix->prefixlen);
       stream_putc (stream, prefix->prefixlen);
@@ -321,6 +323,7 @@ isis_zebra_route_del_ipv4 (struct prefix *prefix,
       api.type = ZEBRA_ROUTE_ISIS;
       api.flags = 0;
       api.message = 0;
+      api.safi = SAFI_UNICAST;
       prefix4.family = AF_INET;
       prefix4.prefixlen = prefix->prefixlen;
       prefix4.prefix = prefix->u.prefix4;
@@ -350,6 +353,7 @@ isis_zebra_route_add_ipv6 (struct prefix *prefix,
   api.type = ZEBRA_ROUTE_ISIS;
   api.flags = 0;
   api.message = 0;
+  api.safi = SAFI_UNICAST;
   SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
   SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX);
   SET_FLAG (api.message, ZAPI_MESSAGE_METRIC);
@@ -433,6 +437,7 @@ isis_zebra_route_del_ipv6 (struct prefix *prefix,
   api.type = ZEBRA_ROUTE_ISIS;
   api.flags = 0;
   api.message = 0;
+  api.safi = SAFI_UNICAST;
   SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
   SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX);
   api.nexthop_num = listcount (route_info->nexthops6);

+ 1 - 0
ospf6d/ospf6_zebra.c

@@ -451,6 +451,7 @@ ospf6_zebra_route_update (int type, struct ospf6_route *request)
   api.type = ZEBRA_ROUTE_OSPF6;
   api.flags = 0;
   api.message = 0;
+  api.safi = SAFI_UNICAST;
   SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
   api.nexthop_num = nhcount;
   api.nexthop = nexthops;

+ 4 - 0
ospfd/ospf_zebra.c

@@ -358,6 +358,7 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or)
       stream_putc (s, ZEBRA_ROUTE_OSPF);
       stream_putc (s, flags);
       stream_putc (s, message);
+      stream_putw (s, SAFI_UNICAST);
 
       /* Put prefix information. */
       psize = PSIZE (p->prefixlen);
@@ -427,6 +428,7 @@ ospf_zebra_delete (struct prefix_ipv4 *p, struct ospf_route *or)
       api.type = ZEBRA_ROUTE_OSPF;
       api.flags = 0;
       api.message = 0;
+      api.safi = SAFI_UNICAST;
       api.ifindex_num = 0;
       api.nexthop_num = 0;
 
@@ -483,6 +485,7 @@ ospf_zebra_add_discard (struct prefix_ipv4 *p)
       api.type = ZEBRA_ROUTE_OSPF;
       api.flags = ZEBRA_FLAG_BLACKHOLE;
       api.message = 0;
+      api.safi = SAFI_UNICAST;
       SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
       api.nexthop_num = 0;
       api.ifindex_num = 0;
@@ -505,6 +508,7 @@ ospf_zebra_delete_discard (struct prefix_ipv4 *p)
       api.type = ZEBRA_ROUTE_OSPF;
       api.flags = ZEBRA_FLAG_BLACKHOLE;
       api.message = 0;
+      api.safi = SAFI_UNICAST;
       SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
       api.nexthop_num = 0;
       api.ifindex_num = 0;

+ 2 - 0
ripd/rip_zebra.c

@@ -46,6 +46,7 @@ rip_zebra_ipv4_add (struct prefix_ipv4 *p, struct in_addr *nexthop,
       api.type = ZEBRA_ROUTE_RIP;
       api.flags = 0;
       api.message = 0;
+      api.safi = SAFI_UNICAST;
       SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
       api.nexthop_num = 1;
       api.nexthop = &nexthop;
@@ -76,6 +77,7 @@ rip_zebra_ipv4_delete (struct prefix_ipv4 *p, struct in_addr *nexthop,
       api.type = ZEBRA_ROUTE_RIP;
       api.flags = 0;
       api.message = 0;
+      api.safi = SAFI_UNICAST;
       SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
       api.nexthop_num = 1;
       api.nexthop = &nexthop;

+ 2 - 0
ripngd/ripng_zebra.c

@@ -53,6 +53,7 @@ ripng_zebra_ipv6_add (struct prefix_ipv6 *p, struct in6_addr *nexthop,
       api.type = ZEBRA_ROUTE_RIPNG;
       api.flags = 0;
       api.message = 0;
+      api.safi = SAFI_UNICAST;
       SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
       api.nexthop_num = 1;
       api.nexthop = &nexthop;
@@ -77,6 +78,7 @@ ripng_zebra_ipv6_delete (struct prefix_ipv6 *p, struct in6_addr *nexthop,
       api.type = ZEBRA_ROUTE_RIPNG;
       api.flags = 0;
       api.message = 0;
+      api.safi = SAFI_UNICAST;
       SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
       api.nexthop_num = 1;
       api.nexthop = &nexthop;