@@ -286,9 +286,9 @@ bool isis_redist_table_is_present(const struct vty *vty,
286
286
}
287
287
288
288
/* Handle notification about route being added */
289
- void isis_redist_add (struct isis * isis , int type , struct prefix * p ,
290
- struct prefix_ipv6 * src_p , uint8_t distance ,
291
- uint32_t metric , const route_tag_t tag , uint16_t table )
289
+ void isis_redist_add (struct isis * isis , int type , struct prefix * p , struct prefix_ipv6 * src_p ,
290
+ uint8_t distance , uint32_t metric , const route_tag_t tag , uint16_t table ,
291
+ struct zapi_nexthop * nexthops , uint16_t nexthop_num )
292
292
{
293
293
int family = p -> family ;
294
294
struct route_table * ei_table = get_ext_info (isis , family );
@@ -298,6 +298,7 @@ void isis_redist_add(struct isis *isis, int type, struct prefix *p,
298
298
struct isis_area * area ;
299
299
int level ;
300
300
struct isis_redist * redist ;
301
+ int i ;
301
302
302
303
zlog_debug ("%s: New route %pFX from %s: distance %d." , __func__ , p ,
303
304
zebra_route_string (type ), distance );
@@ -320,6 +321,11 @@ void isis_redist_add(struct isis *isis, int type, struct prefix *p,
320
321
info -> distance = distance ;
321
322
info -> metric = metric ;
322
323
info -> tag = tag ;
324
+ info -> nexthop_num = nexthop_num ;
325
+
326
+ for (i = 0 ; i < nexthop_num ; i ++ ) {
327
+ info -> nexthop [i ] = nexthop_from_zapi_nexthop (& nexthops [i ]);
328
+ }
323
329
324
330
if (is_default_prefix (p )
325
331
&& (!src_p || !src_p -> prefixlen )) {
@@ -338,8 +344,8 @@ void isis_redist_add(struct isis *isis, int type, struct prefix *p,
338
344
}
339
345
}
340
346
341
- void isis_redist_delete (struct isis * isis , int type , struct prefix * p ,
342
- struct prefix_ipv6 * src_p , uint16_t table )
347
+ void isis_redist_delete (struct isis * isis , int type , struct prefix * p , struct prefix_ipv6 * src_p ,
348
+ uint16_t table , struct zapi_nexthop * nexthops , uint16_t nexthop_num )
343
349
{
344
350
int family = p -> family ;
345
351
struct route_table * ei_table = get_ext_info (isis , family );
@@ -348,6 +354,8 @@ void isis_redist_delete(struct isis *isis, int type, struct prefix *p,
348
354
struct isis_area * area ;
349
355
int level ;
350
356
struct isis_redist * redist ;
357
+ int i ;
358
+ struct isis_ext_info * info ;
351
359
352
360
zlog_debug ("%s: Removing route %pFX from %s." , __func__ , p ,
353
361
zebra_route_string (type ));
@@ -358,8 +366,8 @@ void isis_redist_delete(struct isis *isis, int type, struct prefix *p,
358
366
* by "default-information originate always". Areas without the
359
367
* "always" setting will ignore routes with origin
360
368
* DEFAULT_ROUTE. */
361
- isis_redist_add (isis , DEFAULT_ROUTE , p , NULL , 254 ,
362
- MAX_WIDE_PATH_METRIC , 0 , table );
369
+ isis_redist_add (isis , DEFAULT_ROUTE , p , NULL , 254 , MAX_WIDE_PATH_METRIC , 0 , table ,
370
+ nexthops , nexthop_num );
363
371
return ;
364
372
}
365
373
@@ -390,6 +398,10 @@ void isis_redist_delete(struct isis *isis, int type, struct prefix *p,
390
398
isis_redist_uninstall (area , level , p , src_p );
391
399
}
392
400
401
+ info = ei_node -> info ;
402
+ for (i = 0 ; i < info -> nexthop_num ; i ++ ) {
403
+ nexthop_free (info -> nexthop [i ]);
404
+ }
393
405
XFREE (MTYPE_ISIS_EXT_INFO , ei_node -> info );
394
406
route_unlock_node (ei_node );
395
407
}
0 commit comments