From: Rafael Zalamena Date: Tue, 3 Nov 2020 14:59:38 +0000 (-0300) Subject: Merge pull request #7261 from Niral-Networks/niral_dev_vrf_ospf6 X-Git-Tag: base_7.6~321 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7c62dc76d4e78cce352d511fea89f908a9ee30ce;p=matthieu%2Ffrr.git Merge pull request #7261 from Niral-Networks/niral_dev_vrf_ospf6 ospf6d : Transformation changes for ospf6 vrf support. --- 7c62dc76d4e78cce352d511fea89f908a9ee30ce diff --cc ospf6d/ospf6_abr.c index cbb80b668d,204056120a..f087289df6 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@@ -358,12 -372,13 +361,12 @@@ int ospf6_abr_originate_summary_to_area if (range && !CHECK_FLAG(range->flag, OSPF6_ROUTE_REMOVE) && (route->path.area_id != OSPF_AREA_BACKBONE || !IS_AREA_TRANSIT(area))) { - if (is_debug) { - prefix2str(&range->prefix, buf, sizeof(buf)); - zlog_debug("Suppressed by range %s of area %s", - buf, route_area->name); - } + if (is_debug) + zlog_debug( + "Suppressed by range %pFX of area %s", + &range->prefix, route_area->name); ospf6_abr_delete_route(route, summary, summary_table, - old); + old, area->ospf6); return 0; } } @@@ -805,9 -835,10 +811,9 @@@ void ospf6_abr_old_route_remove(struct old->nh_list ? listcount( old->nh_list) : 0); - } if (table->hook_add) - (*table->hook_add)(old); + (*table->hook_add)(old, ospf6); if ((old->path.origin.id == lsa->header->id) && (old->path.origin.adv_router diff --cc ospf6d/ospf6_intra.c index 733b9cffb1,15bfabb75d..2102afd844 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@@ -984,10 -985,12 +984,10 @@@ int ospf6_intra_prefix_lsa_originate_st /* connected prefix to advertise */ for (route = ospf6_route_head(oi->route_connected); route; route = ospf6_route_best_next(route)) { - if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) { - prefix2str(&route->prefix, buf, sizeof(buf)); - zlog_debug(" include %s", buf); - } + if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) + zlog_debug(" include %pFX", &route->prefix); ospf6_route_add(ospf6_route_copy(route), - route_advertise); + route_advertise, oa->ospf6); } } @@@ -1251,10 -1255,13 +1251,11 @@@ int ospf6_intra_prefix_lsa_originate_tr route->path.area_id = oi->area->area_id; route->path.type = OSPF6_PATH_TYPE_INTRA; - if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) { - prefix2str(&route->prefix, buf, sizeof(buf)); - zlog_debug(" include %s", buf); - } + if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) + zlog_debug(" include %pFX", &route->prefix); - ospf6_route_add(route, route_advertise); + ospf6_route_add(route, route_advertise, + oi->area->ospf6); prefix_num--; } if (current != end && IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) diff --cc ospf6d/ospf6_network.h index 0ec7975e14,56a73fe25f..08d8be4445 --- a/ospf6d/ospf6_network.h +++ b/ospf6d/ospf6_network.h @@@ -26,13 -26,12 +26,14 @@@ extern struct in6_addr alldrouters6 extern int ospf6_serv_sock(struct ospf6 *ospf6); extern void ospf6_serv_close(int *ospf6_sock); - extern int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option); + extern int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option, + int sockfd); -extern int ospf6_sendmsg(struct in6_addr *, struct in6_addr *, ifindex_t *, - struct iovec *, int ospf6_sock); -extern int ospf6_recvmsg(struct in6_addr *, struct in6_addr *, ifindex_t *, - struct iovec *, int ospf6_sock); +extern int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst, + ifindex_t ifindex, struct iovec *message, + int ospf6_sock); +extern int ospf6_recvmsg(struct in6_addr *src, struct in6_addr *dst, + ifindex_t *ifindex, struct iovec *message, + int ospf6_sock); #endif /* OSPF6_NETWORK_H */ diff --cc ospf6d/ospf6_zebra.c index c5c8ca27b9,6ab6153798..b6c712176a --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@@ -210,9 -261,11 +249,10 @@@ DEFUN (show_zebra #define ADD 0 #define REM 1 - static void ospf6_zebra_route_update(int type, struct ospf6_route *request) + static void ospf6_zebra_route_update(int type, struct ospf6_route *request, + struct ospf6 *ospf6) { struct zapi_route api; - char buf[PREFIX2STR_BUFFER]; int nhcount; int ret = 0; struct prefix *dest; @@@ -297,19 -352,22 +337,21 @@@ return; } - void ospf6_zebra_route_update_add(struct ospf6_route *request) + void ospf6_zebra_route_update_add(struct ospf6_route *request, + struct ospf6 *ospf6) { - ospf6_zebra_route_update(ADD, request); + ospf6_zebra_route_update(ADD, request, ospf6); } - void ospf6_zebra_route_update_remove(struct ospf6_route *request) + void ospf6_zebra_route_update_remove(struct ospf6_route *request, + struct ospf6 *ospf6) { - ospf6_zebra_route_update(REM, request); + ospf6_zebra_route_update(REM, request, ospf6); } - void ospf6_zebra_add_discard(struct ospf6_route *request) + void ospf6_zebra_add_discard(struct ospf6_route *request, struct ospf6 *ospf6) { struct zapi_route api; - char buf[INET6_ADDRSTRLEN]; struct prefix *dest = &request->prefix; if (!CHECK_FLAG(request->flag, OSPF6_ROUTE_BLACKHOLE_ADDED)) { @@@ -334,9 -397,11 +376,10 @@@ } } - void ospf6_zebra_delete_discard(struct ospf6_route *request) + void ospf6_zebra_delete_discard(struct ospf6_route *request, + struct ospf6 *ospf6) { struct zapi_route api; - char buf[INET6_ADDRSTRLEN]; struct prefix *dest = &request->prefix; if (CHECK_FLAG(request->flag, OSPF6_ROUTE_BLACKHOLE_ADDED)) {