1 /* Redistribution Handler
2 * Copyright (C) 1998 Kunihiro Ishiguro
4 * This file is part of GNU Zebra.
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 #include "srcdest_table.h"
35 #include "zebra/rib.h"
36 #include "zebra/zserv.h"
37 #include "zebra/zebra_ns.h"
38 #include "zebra/zebra_vrf.h"
39 #include "zebra/zebra_routemap.h"
40 #include "zebra/redistribute.h"
41 #include "zebra/debug.h"
42 #include "zebra/router-id.h"
43 #include "zebra/zapi_msg.h"
44 #include "zebra/zebra_memory.h"
45 #include "zebra/zebra_vxlan.h"
46 #include "zebra/zebra_errors.h"
48 #define ZEBRA_PTM_SUPPORT
50 /* array holding redistribute info about table redistribution */
51 /* bit AFI is set if that AFI is redistributing routes from this table */
52 static int zebra_import_table_used
[AFI_MAX
][ZEBRA_KERNEL_TABLE_MAX
];
53 static uint32_t zebra_import_table_distance
[AFI_MAX
][ZEBRA_KERNEL_TABLE_MAX
];
55 int is_zebra_import_table_enabled(afi_t afi
, uint32_t table_id
)
58 * Make sure that what we are called with actualy makes sense
63 if (is_zebra_valid_kernel_table(table_id
) &&
64 table_id
< ZEBRA_KERNEL_TABLE_MAX
)
65 return zebra_import_table_used
[afi
][table_id
];
69 static void zebra_redistribute_default(struct zserv
*client
, vrf_id_t vrf_id
)
73 struct route_table
*table
;
74 struct route_node
*rn
;
75 struct route_entry
*newre
;
77 for (afi
= AFI_IP
; afi
<= AFI_IP6
; afi
++) {
79 table
= zebra_vrf_table(afi
, SAFI_UNICAST
, vrf_id
);
83 /* Lookup default route. */
84 memset(&p
, 0, sizeof(p
));
85 p
.family
= afi2family(afi
);
86 rn
= route_node_lookup(table
, &p
);
90 RNODE_FOREACH_RE (rn
, newre
) {
91 if (CHECK_FLAG(newre
->flags
, ZEBRA_FLAG_SELECTED
)
92 && newre
->distance
!= DISTANCE_INFINITY
)
93 zsend_redistribute_route(
94 ZEBRA_REDISTRIBUTE_ROUTE_ADD
, client
,
98 route_unlock_node(rn
);
102 /* Redistribute routes. */
103 static void zebra_redistribute(struct zserv
*client
, int type
,
104 unsigned short instance
, vrf_id_t vrf_id
,
107 struct route_entry
*newre
;
108 struct route_table
*table
;
109 struct route_node
*rn
;
111 table
= zebra_vrf_table(afi
, SAFI_UNICAST
, vrf_id
);
115 for (rn
= route_top(table
); rn
; rn
= srcdest_route_next(rn
))
116 RNODE_FOREACH_RE (rn
, newre
) {
117 const struct prefix
*dst_p
, *src_p
;
118 char buf
[PREFIX_STRLEN
];
120 srcdest_rnode_prefixes(rn
, &dst_p
, &src_p
);
122 if (IS_ZEBRA_DEBUG_EVENT
)
124 "%s: client %s %s(%u) checking: selected=%d, type=%d, distance=%d, metric=%d zebra_check_addr=%d",
126 zebra_route_string(client
->proto
),
127 prefix2str(dst_p
, buf
, sizeof(buf
)),
128 vrf_id
, CHECK_FLAG(newre
->flags
,
129 ZEBRA_FLAG_SELECTED
),
130 newre
->type
, newre
->distance
,
131 newre
->metric
, zebra_check_addr(dst_p
));
133 if (!CHECK_FLAG(newre
->flags
, ZEBRA_FLAG_SELECTED
))
135 if ((type
!= ZEBRA_ROUTE_ALL
136 && (newre
->type
!= type
137 || newre
->instance
!= instance
)))
139 if (newre
->distance
== DISTANCE_INFINITY
)
141 if (!zebra_check_addr(dst_p
))
144 zsend_redistribute_route(ZEBRA_REDISTRIBUTE_ROUTE_ADD
,
145 client
, dst_p
, src_p
, newre
);
149 /* Either advertise a route for redistribution to registered clients or */
150 /* withdraw redistribution if add cannot be done for client */
151 void redistribute_update(const struct prefix
*p
, const struct prefix
*src_p
,
152 struct route_entry
*re
, struct route_entry
*prev_re
)
154 struct listnode
*node
, *nnode
;
155 struct zserv
*client
;
156 int send_redistribute
;
158 char buf
[PREFIX_STRLEN
];
160 if (IS_ZEBRA_DEBUG_RIB
) {
162 "%u:%s: Redist update re %p (type %d), old %p (type %d)",
163 re
->vrf_id
, prefix2str(p
, buf
, sizeof(buf
)),
164 re
, re
->type
, prev_re
,
165 prev_re
? prev_re
->type
: -1);
168 afi
= family2afi(p
->family
);
170 flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF
,
171 "%s: Unknown AFI/SAFI prefix received\n",
176 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
)) {
177 send_redistribute
= 0;
179 if (is_default_prefix(p
)
180 && vrf_bitmap_check(client
->redist_default
, re
->vrf_id
))
181 send_redistribute
= 1;
182 else if (vrf_bitmap_check(client
->redist
[afi
][ZEBRA_ROUTE_ALL
],
184 send_redistribute
= 1;
185 else if (re
->instance
186 && redist_check_instance(
187 &client
->mi_redist
[afi
][re
->type
],
189 send_redistribute
= 1;
190 else if (vrf_bitmap_check(client
->redist
[afi
][re
->type
],
192 send_redistribute
= 1;
194 if (send_redistribute
) {
195 if (IS_ZEBRA_DEBUG_EVENT
) {
197 "%s: client %s %s(%u), type=%d, distance=%d, metric=%d",
199 zebra_route_string(client
->proto
),
200 prefix2str(p
, buf
, sizeof(buf
)),
201 re
->vrf_id
, re
->type
,
202 re
->distance
, re
->metric
);
204 zsend_redistribute_route(ZEBRA_REDISTRIBUTE_ROUTE_ADD
,
205 client
, p
, src_p
, re
);
208 && redist_check_instance(
209 &client
->mi_redist
[afi
]
213 client
->redist
[afi
][prev_re
->type
],
215 zsend_redistribute_route(ZEBRA_REDISTRIBUTE_ROUTE_DEL
,
216 client
, p
, src_p
, prev_re
);
221 void redistribute_delete(const struct prefix
*p
, const struct prefix
*src_p
,
222 struct route_entry
*re
)
224 struct listnode
*node
, *nnode
;
225 struct zserv
*client
;
226 char buf
[INET6_ADDRSTRLEN
];
229 if (IS_ZEBRA_DEBUG_RIB
) {
230 inet_ntop(p
->family
, &p
->u
.prefix
, buf
, INET6_ADDRSTRLEN
);
231 zlog_debug("%u:%s/%d: Redist delete re %p (type %d)",
232 re
->vrf_id
, buf
, p
->prefixlen
, re
, re
->type
);
235 /* Add DISTANCE_INFINITY check. */
236 if (re
->distance
== DISTANCE_INFINITY
)
239 afi
= family2afi(p
->family
);
241 flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF
,
242 "%s: Unknown AFI/SAFI prefix received\n",
247 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
)) {
248 if ((is_default_prefix(p
)
249 && vrf_bitmap_check(client
->redist_default
, re
->vrf_id
))
250 || vrf_bitmap_check(client
->redist
[afi
][ZEBRA_ROUTE_ALL
],
253 && redist_check_instance(
254 &client
->mi_redist
[afi
][re
->type
],
256 || vrf_bitmap_check(client
->redist
[afi
][re
->type
],
258 zsend_redistribute_route(ZEBRA_REDISTRIBUTE_ROUTE_DEL
,
259 client
, p
, src_p
, re
);
264 void zebra_redistribute_add(ZAPI_HANDLER_ARGS
)
268 unsigned short instance
;
270 STREAM_GETC(msg
, afi
);
271 STREAM_GETC(msg
, type
);
272 STREAM_GETW(msg
, instance
);
274 if (IS_ZEBRA_DEBUG_EVENT
)
276 "%s: client proto %s afi=%d, wants %s, vrf %u, instance=%d",
277 __func__
, zebra_route_string(client
->proto
), afi
,
278 zebra_route_string(type
), zvrf_id(zvrf
), instance
);
280 if (afi
== 0 || afi
>= AFI_MAX
) {
281 flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF
,
282 "%s: Specified afi %d does not exist",
283 __PRETTY_FUNCTION__
, afi
);
287 if (type
== 0 || type
>= ZEBRA_ROUTE_MAX
) {
288 zlog_debug("%s: Specified Route Type %d does not exist",
289 __PRETTY_FUNCTION__
, type
);
294 if (!redist_check_instance(&client
->mi_redist
[afi
][type
],
296 redist_add_instance(&client
->mi_redist
[afi
][type
],
298 zebra_redistribute(client
, type
, instance
,
302 if (!vrf_bitmap_check(client
->redist
[afi
][type
],
304 if (IS_ZEBRA_DEBUG_EVENT
)
305 zlog_debug("%s: setting vrf %u redist bitmap",
306 __func__
, zvrf_id(zvrf
));
307 vrf_bitmap_set(client
->redist
[afi
][type
],
309 zebra_redistribute(client
, type
, 0, zvrf_id(zvrf
), afi
);
317 void zebra_redistribute_delete(ZAPI_HANDLER_ARGS
)
321 unsigned short instance
;
323 STREAM_GETC(msg
, afi
);
324 STREAM_GETC(msg
, type
);
325 STREAM_GETW(msg
, instance
);
327 if (afi
== 0 || afi
>= AFI_MAX
) {
328 flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF
,
329 "%s: Specified afi %d does not exist",
330 __PRETTY_FUNCTION__
, afi
);
334 if (type
== 0 || type
>= ZEBRA_ROUTE_MAX
) {
335 zlog_debug("%s: Specified Route Type %d does not exist",
336 __PRETTY_FUNCTION__
, type
);
341 * NOTE: no need to withdraw the previously advertised routes. The
343 * themselves should keep track of the received routes from zebra and
344 * withdraw them when necessary.
347 redist_del_instance(&client
->mi_redist
[afi
][type
], instance
);
349 vrf_bitmap_unset(client
->redist
[afi
][type
], zvrf_id(zvrf
));
355 void zebra_redistribute_default_add(ZAPI_HANDLER_ARGS
)
357 vrf_bitmap_set(client
->redist_default
, zvrf_id(zvrf
));
358 zebra_redistribute_default(client
, zvrf_id(zvrf
));
361 void zebra_redistribute_default_delete(ZAPI_HANDLER_ARGS
)
363 vrf_bitmap_unset(client
->redist_default
, zvrf_id(zvrf
));
366 /* Interface up information. */
367 void zebra_interface_up_update(struct interface
*ifp
)
369 struct listnode
*node
, *nnode
;
370 struct zserv
*client
;
372 if (IS_ZEBRA_DEBUG_EVENT
)
373 zlog_debug("MESSAGE: ZEBRA_INTERFACE_UP %s(%u)",
374 ifp
->name
, ifp
->vrf_id
);
376 if (ifp
->ptm_status
|| !ifp
->ptm_enable
) {
377 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
))
378 if (client
->ifinfo
) {
379 zsend_interface_update(ZEBRA_INTERFACE_UP
,
381 zsend_interface_link_params(client
, ifp
);
386 /* Interface down information. */
387 void zebra_interface_down_update(struct interface
*ifp
)
389 struct listnode
*node
, *nnode
;
390 struct zserv
*client
;
392 if (IS_ZEBRA_DEBUG_EVENT
)
393 zlog_debug("MESSAGE: ZEBRA_INTERFACE_DOWN %s(%u)",
394 ifp
->name
, ifp
->vrf_id
);
396 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
)) {
397 zsend_interface_update(ZEBRA_INTERFACE_DOWN
, client
, ifp
);
401 /* Interface information update. */
402 void zebra_interface_add_update(struct interface
*ifp
)
404 struct listnode
*node
, *nnode
;
405 struct zserv
*client
;
407 if (IS_ZEBRA_DEBUG_EVENT
)
408 zlog_debug("MESSAGE: ZEBRA_INTERFACE_ADD %s(%u)", ifp
->name
,
411 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
))
412 if (client
->ifinfo
) {
414 zsend_interface_add(client
, ifp
);
415 zsend_interface_link_params(client
, ifp
);
419 void zebra_interface_delete_update(struct interface
*ifp
)
421 struct listnode
*node
, *nnode
;
422 struct zserv
*client
;
424 if (IS_ZEBRA_DEBUG_EVENT
)
425 zlog_debug("MESSAGE: ZEBRA_INTERFACE_DELETE %s(%u)",
426 ifp
->name
, ifp
->vrf_id
);
428 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
)) {
430 zsend_interface_delete(client
, ifp
);
434 /* Interface address addition. */
435 void zebra_interface_address_add_update(struct interface
*ifp
,
436 struct connected
*ifc
)
438 struct listnode
*node
, *nnode
;
439 struct zserv
*client
;
442 if (IS_ZEBRA_DEBUG_EVENT
) {
443 char buf
[PREFIX_STRLEN
];
446 zlog_debug("MESSAGE: ZEBRA_INTERFACE_ADDRESS_ADD %s on %s(%u)",
447 prefix2str(p
, buf
, sizeof(buf
)), ifp
->name
,
451 if (!CHECK_FLAG(ifc
->conf
, ZEBRA_IFC_REAL
))
453 EC_ZEBRA_ADVERTISING_UNUSABLE_ADDR
,
454 "WARNING: advertising address to clients that is not yet usable.");
456 zebra_vxlan_add_del_gw_macip(ifp
, ifc
->address
, 1);
458 router_id_add_address(ifc
);
460 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
))
461 if (CHECK_FLAG(ifc
->conf
, ZEBRA_IFC_REAL
)) {
462 client
->connected_rt_add_cnt
++;
463 zsend_interface_address(ZEBRA_INTERFACE_ADDRESS_ADD
,
468 /* Interface address deletion. */
469 void zebra_interface_address_delete_update(struct interface
*ifp
,
470 struct connected
*ifc
)
472 struct listnode
*node
, *nnode
;
473 struct zserv
*client
;
476 if (IS_ZEBRA_DEBUG_EVENT
) {
477 char buf
[PREFIX_STRLEN
];
480 zlog_debug("MESSAGE: ZEBRA_INTERFACE_ADDRESS_DELETE %s on %s(%u)",
481 prefix2str(p
, buf
, sizeof(buf
)),
482 ifp
->name
, ifp
->vrf_id
);
485 zebra_vxlan_add_del_gw_macip(ifp
, ifc
->address
, 0);
487 router_id_del_address(ifc
);
489 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
))
490 if (CHECK_FLAG(ifc
->conf
, ZEBRA_IFC_REAL
)) {
491 client
->connected_rt_del_cnt
++;
492 zsend_interface_address(ZEBRA_INTERFACE_ADDRESS_DELETE
,
497 /* Interface VRF change. May need to delete from clients not interested in
498 * the new VRF. Note that this function is invoked *prior* to the VRF change.
500 void zebra_interface_vrf_update_del(struct interface
*ifp
, vrf_id_t new_vrf_id
)
502 struct listnode
*node
, *nnode
;
503 struct zserv
*client
;
505 if (IS_ZEBRA_DEBUG_EVENT
)
507 "MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/DEL %s VRF Id %u -> %u",
508 ifp
->name
, ifp
->vrf_id
, new_vrf_id
);
510 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
)) {
511 /* Need to delete if the client is not interested in the new
513 zsend_interface_update(ZEBRA_INTERFACE_DOWN
, client
, ifp
);
515 zsend_interface_delete(client
, ifp
);
516 zsend_interface_vrf_update(client
, ifp
, new_vrf_id
);
520 /* Interface VRF change. This function is invoked *post* VRF change and sends an
521 * add to clients who are interested in the new VRF but not in the old VRF.
523 void zebra_interface_vrf_update_add(struct interface
*ifp
, vrf_id_t old_vrf_id
)
525 struct listnode
*node
, *nnode
;
526 struct zserv
*client
;
528 if (IS_ZEBRA_DEBUG_EVENT
)
530 "MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/ADD %s VRF Id %u -> %u",
531 ifp
->name
, old_vrf_id
, ifp
->vrf_id
);
533 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
)) {
534 /* Need to add if the client is interested in the new VRF. */
536 zsend_interface_add(client
, ifp
);
537 zsend_interface_addresses(client
, ifp
);
541 int zebra_add_import_table_entry(struct route_node
*rn
, struct route_entry
*re
,
542 const char *rmap_name
)
544 struct route_entry
*newre
;
545 struct route_entry
*same
;
547 route_map_result_t ret
= RMAP_MATCH
;
550 afi
= family2afi(rn
->p
.family
);
552 ret
= zebra_import_table_route_map_check(
553 afi
, re
->type
, re
->instance
, &rn
->p
, re
->ng
.nexthop
,
554 re
->vrf_id
, re
->tag
, rmap_name
);
556 if (ret
!= RMAP_MATCH
) {
557 UNSET_FLAG(re
->flags
, ZEBRA_FLAG_SELECTED
);
558 zebra_del_import_table_entry(rn
, re
);
562 prefix_copy(&p
, &rn
->p
);
564 RNODE_FOREACH_RE (rn
, same
) {
565 if (CHECK_FLAG(same
->status
, ROUTE_ENTRY_REMOVED
))
568 if (same
->type
== re
->type
&& same
->instance
== re
->instance
569 && same
->table
== re
->table
570 && same
->type
!= ZEBRA_ROUTE_CONNECT
)
575 UNSET_FLAG(same
->flags
, ZEBRA_FLAG_SELECTED
);
576 zebra_del_import_table_entry(rn
, same
);
579 newre
= XCALLOC(MTYPE_RE
, sizeof(struct route_entry
));
580 newre
->type
= ZEBRA_ROUTE_TABLE
;
581 newre
->distance
= zebra_import_table_distance
[afi
][re
->table
];
582 newre
->flags
= re
->flags
;
583 newre
->metric
= re
->metric
;
584 newre
->mtu
= re
->mtu
;
585 newre
->table
= zebrad
.rtm_table_default
;
586 newre
->nexthop_num
= 0;
587 newre
->uptime
= time(NULL
);
588 newre
->instance
= re
->table
;
589 route_entry_copy_nexthops(newre
, re
->ng
.nexthop
);
591 rib_add_multipath(afi
, SAFI_UNICAST
, &p
, NULL
, newre
);
596 int zebra_del_import_table_entry(struct route_node
*rn
, struct route_entry
*re
)
601 afi
= family2afi(rn
->p
.family
);
602 prefix_copy(&p
, &rn
->p
);
604 rib_delete(afi
, SAFI_UNICAST
, re
->vrf_id
, ZEBRA_ROUTE_TABLE
, re
->table
,
605 re
->flags
, &p
, NULL
, re
->ng
.nexthop
,
606 zebrad
.rtm_table_default
, re
->metric
, re
->distance
, false);
611 /* Assuming no one calls this with the main routing table */
612 int zebra_import_table(afi_t afi
, uint32_t table_id
, uint32_t distance
,
613 const char *rmap_name
, int add
)
615 struct route_table
*table
;
616 struct route_entry
*re
;
617 struct route_node
*rn
;
619 if (!is_zebra_valid_kernel_table(table_id
)
620 || ((table_id
== RT_TABLE_MAIN
)
621 || (table_id
== zebrad
.rtm_table_default
)))
627 table
= zebra_vrf_other_route_table(afi
, table_id
, VRF_DEFAULT
);
630 } else if (IS_ZEBRA_DEBUG_RIB
) {
631 zlog_debug("%s routes from table %d",
632 add
? "Importing" : "Unimporting", table_id
);
637 zebra_add_import_table_route_map(afi
, rmap_name
,
641 zebra_get_import_table_route_map(afi
, table_id
);
643 zebra_del_import_table_route_map(afi
, table_id
);
648 zebra_import_table_used
[afi
][table_id
] = 1;
649 zebra_import_table_distance
[afi
][table_id
] = distance
;
651 zebra_import_table_used
[afi
][table_id
] = 0;
652 zebra_import_table_distance
[afi
][table_id
] =
653 ZEBRA_TABLE_DISTANCE_DEFAULT
;
655 rmap_name
= zebra_get_import_table_route_map(afi
, table_id
);
657 zebra_del_import_table_route_map(afi
, table_id
);
662 for (rn
= route_top(table
); rn
; rn
= route_next(rn
)) {
663 /* For each entry in the non-default routing table,
664 * add the entry in the main table
669 RNODE_FOREACH_RE (rn
, re
) {
670 if (CHECK_FLAG(re
->status
, ROUTE_ENTRY_REMOVED
))
678 if (((afi
== AFI_IP
) && (rn
->p
.family
== AF_INET
))
679 || ((afi
== AFI_IP6
) && (rn
->p
.family
== AF_INET6
))) {
681 zebra_add_import_table_entry(rn
, re
, rmap_name
);
683 zebra_del_import_table_entry(rn
, re
);
689 int zebra_import_table_config(struct vty
*vty
)
694 char afi_str
[AFI_MAX
][10] = {"", "ip", "ipv6", "ethernet"};
695 const char *rmap_name
;
697 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++) {
698 for (i
= 1; i
< ZEBRA_KERNEL_TABLE_MAX
; i
++) {
699 if (!is_zebra_import_table_enabled(afi
, i
))
702 if (zebra_import_table_distance
[afi
][i
]
703 != ZEBRA_TABLE_DISTANCE_DEFAULT
) {
704 vty_out(vty
, "%s import-table %d distance %d",
706 zebra_import_table_distance
[afi
][i
]);
708 vty_out(vty
, "%s import-table %d", afi_str
[afi
],
712 rmap_name
= zebra_get_import_table_route_map(afi
, i
);
714 vty_out(vty
, " route-map %s", rmap_name
);
724 void zebra_import_table_rm_update(const char *rmap
)
728 struct route_table
*table
;
729 struct route_entry
*re
;
730 struct route_node
*rn
;
731 const char *rmap_name
;
733 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++) {
734 for (i
= 1; i
< ZEBRA_KERNEL_TABLE_MAX
; i
++) {
735 if (!is_zebra_import_table_enabled(afi
, i
))
738 rmap_name
= zebra_get_import_table_route_map(afi
, i
);
739 if ((!rmap_name
) || (strcmp(rmap_name
, rmap
) != 0))
741 table
= zebra_vrf_other_route_table(afi
, i
,
743 for (rn
= route_top(table
); rn
; rn
= route_next(rn
)) {
744 /* For each entry in the non-default
746 * add the entry in the main table
751 RNODE_FOREACH_RE (rn
, re
) {
752 if (CHECK_FLAG(re
->status
,
753 ROUTE_ENTRY_REMOVED
))
762 && (rn
->p
.family
== AF_INET
))
764 && (rn
->p
.family
== AF_INET6
)))
765 zebra_add_import_table_entry(rn
, re
,
774 /* Interface parameters update */
775 void zebra_interface_parameters_update(struct interface
*ifp
)
777 struct listnode
*node
, *nnode
;
778 struct zserv
*client
;
780 if (IS_ZEBRA_DEBUG_EVENT
)
781 zlog_debug("MESSAGE: ZEBRA_INTERFACE_LINK_PARAMS %s(%u)",
782 ifp
->name
, ifp
->vrf_id
);
784 for (ALL_LIST_ELEMENTS(zebrad
.client_list
, node
, nnode
, client
))
786 zsend_interface_link_params(client
, ifp
);