diff options
| -rw-r--r-- | .github/workflows/commitlint.yml | 5 | ||||
| -rw-r--r-- | babeld/message.c | 6 | ||||
| -rw-r--r-- | bfdd/bfd_packet.c | 8 | ||||
| -rw-r--r-- | bgpd/bgp_attr.c | 88 | ||||
| -rw-r--r-- | bgpd/bgp_evpn.c | 23 | ||||
| -rw-r--r-- | bgpd/bgp_label.c | 15 | ||||
| -rw-r--r-- | bgpd/bgp_route.c | 12 | ||||
| -rw-r--r-- | bgpd/bgp_vty.c | 35 | ||||
| -rw-r--r-- | bgpd/rfapi/rfapi_import.c | 53 | ||||
| -rw-r--r-- | bgpd/rfapi/vnc_import_bgp.c | 4 | ||||
| -rw-r--r-- | doc/developer/cli.rst | 46 | ||||
| -rw-r--r-- | doc/developer/workflow.rst | 2 | ||||
| -rw-r--r-- | doc/user/bgp.rst | 2 | ||||
| -rw-r--r-- | ospf6d/ospf6_abr.c | 9 | ||||
| -rw-r--r-- | ospf6d/ospf6_asbr.c | 20 | ||||
| -rw-r--r-- | ospf6d/ospf6_asbr.h | 2 | ||||
| -rw-r--r-- | ospf6d/ospf6_route.c | 3 | ||||
| -rw-r--r-- | ospf6d/ospf6_route.h | 2 | ||||
| -rw-r--r-- | ospf6d/ospf6_zebra.c | 6 |
19 files changed, 179 insertions, 162 deletions
diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index ea5b704188..06bf3b3b95 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -10,8 +10,9 @@ on: - unlabeled jobs: - lint: - if: github.repository == 'frrouting/frr' + commitlint: + if: github.repository == 'frrouting/frr' && github.base_ref == 'refs/heads/master' + name: Check if the commits meet the requirements of the guidelines permissions: contents: read pull-requests: read diff --git a/babeld/message.c b/babeld/message.c index 687f768446..b5c2a58984 100644 --- a/babeld/message.c +++ b/babeld/message.c @@ -422,7 +422,7 @@ parse_packet(const unsigned char *from, struct interface *ifp, debugf(BABEL_DEBUG_COMMON, "Received Hello from %s on %s that does not have all 0's in the unused section of flags, ignoring", format_address(from), ifp->name); - continue; + goto done; } /* @@ -434,7 +434,7 @@ parse_packet(const unsigned char *from, struct interface *ifp, debugf(BABEL_DEBUG_COMMON, "Received Unicast Hello from %s on %s that FRR is not prepared to understand yet", format_address(from), ifp->name); - continue; + goto done; } DO_NTOHS(seqno, message + 4); @@ -452,7 +452,7 @@ parse_packet(const unsigned char *from, struct interface *ifp, debugf(BABEL_DEBUG_COMMON, "Received hello from %s on %s should be ignored as that this version of FRR does not know how to properly handle interval == 0", format_address(from), ifp->name); - continue; + goto done; } changed = update_neighbour(neigh, seqno, interval); diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index 7be235326c..88a9310bc6 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -140,7 +140,7 @@ int _ptm_bfd_send(struct bfd_session *bs, uint16_t *port, const void *data, * sizeof(*pkt) * * ip - * IP address that pkt will be transmitted from and too. + * IP address that pkt will be transmitted from and to. * * Returns: * Checksum in network byte order. @@ -481,12 +481,6 @@ ssize_t bfd_recv_ipv4_fp(int sd, uint8_t *msgbuf, size_t msgbuflen, *ttl = ip->ttl; if (*ttl != 254) { - /* Echo should be looped in peer's forwarding plane, but it also - * comes up to BFD so silently drop it - */ - if (ip->daddr == ip->saddr) - return -1; - if (bglobal.debug_network) zlog_debug("%s: invalid TTL: %u", __func__, *ttl); return -1; diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index de77bd5304..68be9675ca 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -810,55 +810,55 @@ bool attrhash_cmp(const void *p1, const void *p2) && attr1->med == attr2->med && attr1->local_pref == attr2->local_pref && attr1->rmap_change_flags == attr2->rmap_change_flags) { - if (attr1->aggregator_as == attr2->aggregator_as - && attr1->aggregator_addr.s_addr - == attr2->aggregator_addr.s_addr - && attr1->weight == attr2->weight - && attr1->tag == attr2->tag - && attr1->label_index == attr2->label_index - && attr1->mp_nexthop_len == attr2->mp_nexthop_len - && bgp_attr_get_ecommunity(attr1) - == bgp_attr_get_ecommunity(attr2) - && bgp_attr_get_ipv6_ecommunity(attr1) - == bgp_attr_get_ipv6_ecommunity(attr2) - && bgp_attr_get_lcommunity(attr1) - == bgp_attr_get_lcommunity(attr2) - && bgp_attr_get_cluster(attr1) - == bgp_attr_get_cluster(attr2) - && bgp_attr_get_transit(attr1) - == bgp_attr_get_transit(attr2) - && bgp_attr_get_aigp_metric(attr1) - == bgp_attr_get_aigp_metric(attr2) - && attr1->rmap_table_id == attr2->rmap_table_id - && (attr1->encap_tunneltype == attr2->encap_tunneltype) - && encap_same(attr1->encap_subtlvs, attr2->encap_subtlvs) + if (attr1->aggregator_as == attr2->aggregator_as && + attr1->aggregator_addr.s_addr == + attr2->aggregator_addr.s_addr && + attr1->weight == attr2->weight && + attr1->tag == attr2->tag && + attr1->label_index == attr2->label_index && + attr1->mp_nexthop_len == attr2->mp_nexthop_len && + bgp_attr_get_ecommunity(attr1) == + bgp_attr_get_ecommunity(attr2) && + bgp_attr_get_ipv6_ecommunity(attr1) == + bgp_attr_get_ipv6_ecommunity(attr2) && + bgp_attr_get_lcommunity(attr1) == + bgp_attr_get_lcommunity(attr2) && + bgp_attr_get_cluster(attr1) == + bgp_attr_get_cluster(attr2) && + bgp_attr_get_transit(attr1) == + bgp_attr_get_transit(attr2) && + bgp_attr_get_aigp_metric(attr1) == + bgp_attr_get_aigp_metric(attr2) && + attr1->rmap_table_id == attr2->rmap_table_id && + (attr1->encap_tunneltype == attr2->encap_tunneltype) && + encap_same(attr1->encap_subtlvs, attr2->encap_subtlvs) #ifdef ENABLE_BGP_VNC && encap_same(bgp_attr_get_vnc_subtlvs(attr1), bgp_attr_get_vnc_subtlvs(attr2)) #endif && IPV6_ADDR_SAME(&attr1->mp_nexthop_global, - &attr2->mp_nexthop_global) - && IPV6_ADDR_SAME(&attr1->mp_nexthop_local, - &attr2->mp_nexthop_local) - && IPV4_ADDR_SAME(&attr1->mp_nexthop_global_in, - &attr2->mp_nexthop_global_in) - && IPV4_ADDR_SAME(&attr1->originator_id, - &attr2->originator_id) - && overlay_index_same(attr1, attr2) - && !memcmp(&attr1->esi, &attr2->esi, sizeof(esi_t)) - && attr1->es_flags == attr2->es_flags - && attr1->mm_sync_seqnum == attr2->mm_sync_seqnum - && attr1->df_pref == attr2->df_pref - && attr1->df_alg == attr2->df_alg - && attr1->nh_ifindex == attr2->nh_ifindex - && attr1->nh_lla_ifindex == attr2->nh_lla_ifindex - && attr1->distance == attr2->distance - && srv6_l3vpn_same(attr1->srv6_l3vpn, attr2->srv6_l3vpn) - && srv6_vpn_same(attr1->srv6_vpn, attr2->srv6_vpn) - && attr1->srte_color == attr2->srte_color - && attr1->nh_type == attr2->nh_type - && attr1->bh_type == attr2->bh_type - && attr1->otc == attr2->otc) + &attr2->mp_nexthop_global) && + IPV6_ADDR_SAME(&attr1->mp_nexthop_local, + &attr2->mp_nexthop_local) && + IPV4_ADDR_SAME(&attr1->mp_nexthop_global_in, + &attr2->mp_nexthop_global_in) && + IPV4_ADDR_SAME(&attr1->originator_id, + &attr2->originator_id) && + overlay_index_same(attr1, attr2) && + !memcmp(&attr1->esi, &attr2->esi, sizeof(esi_t)) && + attr1->es_flags == attr2->es_flags && + attr1->mm_sync_seqnum == attr2->mm_sync_seqnum && + attr1->df_pref == attr2->df_pref && + attr1->df_alg == attr2->df_alg && + attr1->nh_ifindex == attr2->nh_ifindex && + attr1->nh_lla_ifindex == attr2->nh_lla_ifindex && + attr1->distance == attr2->distance && + srv6_l3vpn_same(attr1->srv6_l3vpn, attr2->srv6_l3vpn) && + srv6_vpn_same(attr1->srv6_vpn, attr2->srv6_vpn) && + attr1->srte_color == attr2->srte_color && + attr1->nh_type == attr2->nh_type && + attr1->bh_type == attr2->bh_type && + attr1->otc == attr2->otc) return true; } diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index a8560ab539..11e38aa033 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -1837,6 +1837,7 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, struct bgp_path_info *tmp_pi; struct bgp_path_info *local_pi; struct attr *attr_new; + struct attr local_attr; mpls_label_t label[BGP_MAX_LABELS]; uint32_t num_labels = 1; int route_change = 1; @@ -1870,13 +1871,15 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, add_mac_mobility_to_attr(seq, attr); if (!local_pi) { - /* Add (or update) attribute to hash. */ - attr_new = bgp_attr_intern(attr); + local_attr = *attr; /* Extract MAC mobility sequence number, if any. */ - attr_new->mm_seqnum = - bgp_attr_mac_mobility_seqnum(attr_new, &sticky); - attr_new->sticky = sticky; + local_attr.mm_seqnum = + bgp_attr_mac_mobility_seqnum(&local_attr, &sticky); + local_attr.sticky = sticky; + + /* Add (or update) attribute to hash. */ + attr_new = bgp_attr_intern(&local_attr); /* Create new route with its attribute. */ tmp_pi = info_make(ZEBRA_ROUTE_BGP, BGP_ROUTE_STATIC, 0, @@ -1952,14 +1955,16 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, /* The attribute has changed. */ /* Add (or update) attribute to hash. */ - attr_new = bgp_attr_intern(attr); + local_attr = *attr; bgp_path_info_set_flag(dest, tmp_pi, BGP_PATH_ATTR_CHANGED); /* Extract MAC mobility sequence number, if any. */ - attr_new->mm_seqnum = - bgp_attr_mac_mobility_seqnum(attr_new, &sticky); - attr_new->sticky = sticky; + local_attr.mm_seqnum = bgp_attr_mac_mobility_seqnum( + &local_attr, &sticky); + local_attr.sticky = sticky; + + attr_new = bgp_attr_intern(&local_attr); /* Restore route, if needed. */ if (CHECK_FLAG(tmp_pi->flags, BGP_PATH_REMOVED)) diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c index 0cad119af1..414dafebd4 100644 --- a/bgpd/bgp_label.c +++ b/bgpd/bgp_label.c @@ -297,6 +297,9 @@ static int bgp_nlri_get_labels(struct peer *peer, uint8_t *pnt, uint8_t plen, uint8_t llen = 0; uint8_t label_depth = 0; + if (plen < BGP_LABEL_BYTES) + return 0; + for (; data < lim; data += BGP_LABEL_BYTES) { memcpy(label, data, BGP_LABEL_BYTES); llen += BGP_LABEL_BYTES; @@ -359,6 +362,9 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr, memcpy(&addpath_id, pnt, BGP_ADDPATH_ID_LEN); addpath_id = ntohl(addpath_id); pnt += BGP_ADDPATH_ID_LEN; + + if (pnt >= lim) + return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW; } /* Fetch prefix length. */ @@ -377,6 +383,13 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr, /* Fill in the labels */ llen = bgp_nlri_get_labels(peer, pnt, psize, &label); + if (llen == 0) { + flog_err( + EC_BGP_UPDATE_RCV, + "%s [Error] Update packet error (wrong label length 0)", + peer->host); + return BGP_NLRI_PARSE_ERROR_LABEL_LENGTH; + } p.prefixlen = prefixlen - BSIZE(llen); /* There needs to be at least one label */ @@ -384,8 +397,6 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr, flog_err(EC_BGP_UPDATE_RCV, "%s [Error] Update packet error (wrong label length %d)", peer->host, prefixlen); - bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, - BGP_NOTIFY_UPDATE_INVAL_NETWORK); return BGP_NLRI_PARSE_ERROR_LABEL_LENGTH; } diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 1e9f9429c5..56f548bfd5 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2921,10 +2921,14 @@ void subgroup_process_announce_selected(struct update_subgroup *subgrp, * in FIB, then it is advertised */ if (advertise) { - if (!bgp_check_withdrawal(bgp, dest)) - bgp_adj_out_set_subgroup( - dest, subgrp, &attr, selected); - else + if (!bgp_check_withdrawal(bgp, dest)) { + struct attr *adv_attr = + bgp_attr_intern(&attr); + + bgp_adj_out_set_subgroup(dest, subgrp, + adv_attr, + selected); + } else bgp_adj_out_unset_subgroup( dest, subgrp, 1, addpath_tx_id); } diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index a1e9a9a8a9..93b412240a 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -11676,37 +11676,22 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, vty_out(vty, "4 "); vty_out(vty, ASN_FORMAT_SPACE(bgp->asnotation), &peer->as); - if (show_wide) { + if (show_wide) vty_out(vty, ASN_FORMAT_SPACE( bgp->asnotation), peer->change_local_as ? &peer->change_local_as : &peer->local_as); - vty_out(vty, - " %9u %9u %8" PRIu64 - " %4zu %4zu %8s", - PEER_TOTAL_RX(peer), - PEER_TOTAL_TX(peer), - peer->version[afi][safi], - inq_count, outq_count, - peer_uptime(peer->uptime, - timebuf, - BGP_UPTIME_LEN, 0, - NULL)); - } else { - vty_out(vty, - " %9u %9u %8" PRIu64 - " %4zu %4zu %8s", - PEER_TOTAL_RX(peer), - PEER_TOTAL_TX(peer), - peer->version[afi][safi], - inq_count, outq_count, - peer_uptime(peer->uptime, - timebuf, - BGP_UPTIME_LEN, 0, - NULL)); - } + vty_out(vty, + " %9u %9u %8" PRIu64 " %4zu %4zu %8s", + PEER_TOTAL_RX(peer), + PEER_TOTAL_TX(peer), + peer->version[afi][safi], inq_count, + outq_count, + peer_uptime(peer->uptime, timebuf, + BGP_UPTIME_LEN, 0, NULL)); + if (peer_established(peer)) { if (peer->afc_recv[afi][safi]) { if (CHECK_FLAG( diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 5c68545398..25a4403040 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -874,33 +874,39 @@ static void rfapiImportTableFlush(struct rfapi_import_table *it) for (afi = AFI_IP; afi < AFI_MAX; ++afi) { struct agg_node *rn; + struct agg_table *at; - for (rn = agg_route_top(it->imported_vpn[afi]); rn; - rn = agg_route_next(rn)) { - /* - * Each route_node has: - * aggregate: points to rfapi_it_extra with monitor - * chain(s) - * info: points to chain of bgp_path_info - */ - /* free bgp_path_info and its children */ - rfapiBgpInfoChainFree(rn->info); - rn->info = NULL; + at = it->imported_vpn[afi]; + if (at) { + for (rn = agg_route_top(at); rn; + rn = agg_route_next(rn)) { + /* + * Each route_node has: + * aggregate: points to rfapi_it_extra with + * monitor chain(s) + * info: points to chain of bgp_path_info + */ + /* free bgp_path_info and its children */ + rfapiBgpInfoChainFree(rn->info); + rn->info = NULL; - rfapiMonitorExtraFlush(SAFI_MPLS_VPN, rn); + rfapiMonitorExtraFlush(SAFI_MPLS_VPN, rn); + } + agg_table_finish(at); } - for (rn = agg_route_top(it->imported_encap[afi]); rn; - rn = agg_route_next(rn)) { - /* free bgp_path_info and its children */ - rfapiBgpInfoChainFree(rn->info); - rn->info = NULL; + if (at) { + at = it->imported_encap[afi]; + for (rn = agg_route_top(at); rn; + rn = agg_route_next(rn)) { + /* free bgp_path_info and its children */ + rfapiBgpInfoChainFree(rn->info); + rn->info = NULL; - rfapiMonitorExtraFlush(SAFI_ENCAP, rn); + rfapiMonitorExtraFlush(SAFI_ENCAP, rn); + } + agg_table_finish(at); } - - agg_table_finish(it->imported_vpn[afi]); - agg_table_finish(it->imported_encap[afi]); } if (it->monitor_exterior_orphans) { skiplist_free(it->monitor_exterior_orphans); @@ -4260,10 +4266,7 @@ void bgp_rfapi_destroy(struct bgp *bgp, struct rfapi *h) h->resolve_nve_nexthop = NULL; } - agg_table_finish(h->it_ce->imported_vpn[AFI_IP]); - agg_table_finish(h->it_ce->imported_vpn[AFI_IP6]); - agg_table_finish(h->it_ce->imported_encap[AFI_IP]); - agg_table_finish(h->it_ce->imported_encap[AFI_IP6]); + rfapiImportTableFlush(h->it_ce); if (h->import_mac) { struct rfapi_import_table *it; diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index 7c8e8f35c9..19ac6f353d 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -834,6 +834,8 @@ static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp, if (ecom) ecommunity_free(&ecom); + if (iattr) + bgp_attr_unintern(&iattr); } static void vnc_import_bgp_add_route_mode_nvegroup( @@ -1030,6 +1032,8 @@ static void vnc_import_bgp_add_route_mode_nvegroup( if (ecom) ecommunity_free(&ecom); + if (iattr) + bgp_attr_unintern(&iattr); } static void vnc_import_bgp_del_route_mode_plain(struct bgp *bgp, diff --git a/doc/developer/cli.rst b/doc/developer/cli.rst index 2a08531bd7..61b9cf6acb 100644 --- a/doc/developer/cli.rst +++ b/doc/developer/cli.rst @@ -177,29 +177,29 @@ parser, but this is merely a dumb copy job. Here is a brief summary of the various token types along with examples. -+-----------------+-------------------------+-------------------------------------------------------+ -| Token type | Syntax | Description | -+=================+=========================+=======================================================+ -| ``WORD`` | ``show ip bgp`` | Matches itself. In the example every token is a WORD. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``IPV4`` | ``A.B.C.D`` | Matches an IPv4 address. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``IPV6`` | ``X:X::X:X`` | Matches an IPv6 address. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``IPV4_PREFIX`` | ``A.B.C.D/M`` | Matches an IPv4 prefix in CIDR notation. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``IPV6_PREFIX`` | ``X:X::X:X/M`` | Matches an IPv6 prefix in CIDR notation. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``MAC`` | ``X:X:X:X:X:X`` | Matches a 48-bit mac address. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``MAC_PREFIX`` | ``X:X:X:X:X:X/M`` | Matches a 48-bit mac address with a mask. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``VARIABLE`` | ``FOOBAR`` | Matches anything. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``RANGE`` | ``(X-Y)`` | Matches numbers in the range X..Y inclusive. | -+-----------------+-------------------------+-------------------------------------------------------+ -| ``ASNUM`` | ``<A.B|(1-4294967295>`` | Matches an AS in plain or dot format. | -+-----------------+-------------------------+-------------------------------------------------------+ ++-----------------+--------------------------+-------------------------------------------------------+ +| Token type | Syntax | Description | ++=================+==========================+=======================================================+ +| ``WORD`` | ``show ip bgp`` | Matches itself. In the example every token is a WORD. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``IPV4`` | ``A.B.C.D`` | Matches an IPv4 address. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``IPV6`` | ``X:X::X:X`` | Matches an IPv6 address. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``IPV4_PREFIX`` | ``A.B.C.D/M`` | Matches an IPv4 prefix in CIDR notation. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``IPV6_PREFIX`` | ``X:X::X:X/M`` | Matches an IPv6 prefix in CIDR notation. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``MAC`` | ``X:X:X:X:X:X`` | Matches a 48-bit mac address. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``MAC_PREFIX`` | ``X:X:X:X:X:X/M`` | Matches a 48-bit mac address with a mask. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``VARIABLE`` | ``FOOBAR`` | Matches anything. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``RANGE`` | ``(X-Y)`` | Matches numbers in the range X..Y inclusive. | ++-----------------+--------------------------+-------------------------------------------------------+ +| ``ASNUM`` | ``<A.B|(1-4294967295)>`` | Matches an AS in plain or dot format. | ++-----------------+--------------------------+-------------------------------------------------------+ When presented with user input, the parser will search over all defined commands in the current context to find a match. It is aware of the various diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst index 835c1d1d99..f11fff5dee 100644 --- a/doc/developer/workflow.rst +++ b/doc/developer/workflow.rst @@ -95,7 +95,7 @@ March/July/November. Walking backwards from this date: are considered lowest priority (regardless of when they were opened.) - 4 weeks earlier, the stable branch separates from master (named - ``dev/MAJOR.MINOR`` at this point) and tagged as ```base_X.Y``. + ``dev/MAJOR.MINOR`` at this point) and tagged as ``base_X.Y``. Master is unfrozen and new features may again proceed. Part of unfreezing master is editing the ``AC_INIT`` statement in diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst index 1798f1ad2a..946f0699f2 100644 --- a/doc/user/bgp.rst +++ b/doc/user/bgp.rst @@ -2290,7 +2290,7 @@ Numbered Community Lists ^^^^^^^^^^^^^^^^^^^^^^^^ When number is used for BGP community list name, the number has -special meanings. Community list number in the range from 1 and 99 is +special meanings. Community list number in the range from 1 to 99 is standard community list. Community list number in the range from 100 to 500 is expanded community list. These community lists are called as numbered community lists. On the other hand normal community lists diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index 0575f5abe1..4def3c7386 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -1136,11 +1136,9 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa) } if (CHECK_FLAG(prefix_lsa->prefix.prefix_options, - OSPF6_PREFIX_OPTION_NU) - || CHECK_FLAG(prefix_lsa->prefix.prefix_options, - OSPF6_PREFIX_OPTION_LA)) { + OSPF6_PREFIX_OPTION_NU)) { if (is_debug) - zlog_debug("Prefix has NU/LA bit set, ignore"); + zlog_debug("Prefix has the NU bit set, ignore"); if (old) ospf6_route_remove(old, table); return; @@ -1153,7 +1151,8 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa) if (!OSPF6_OPT_ISSET(router_lsa->options, OSPF6_OPT_R) || !OSPF6_OPT_ISSET(router_lsa->options, OSPF6_OPT_V6)) { if (is_debug) - zlog_debug("Prefix has NU/LA bit set, ignore"); + zlog_debug( + "Router-LSA has the V6-bit or R-bit unset, ignore"); if (old) ospf6_route_remove(old, table); diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 05275c52ea..b2cdbc9b57 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -1380,8 +1380,8 @@ ospf6_external_aggr_match(struct ospf6 *ospf6, struct prefix *p) void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex, struct prefix *prefix, unsigned int nexthop_num, - struct in6_addr *nexthop, route_tag_t tag, - struct ospf6 *ospf6) + const struct in6_addr *nexthop, + route_tag_t tag, struct ospf6 *ospf6) { route_map_result_t ret; struct ospf6_route troute; @@ -1469,9 +1469,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex, info->type = type; - if (nexthop_num && nexthop) + if (nexthop_num && nexthop) { ospf6_route_add_nexthop(match, ifindex, nexthop); - else + if (!IN6_IS_ADDR_UNSPECIFIED(nexthop) + && !IN6_IS_ADDR_LINKLOCAL(nexthop)) + memcpy(&info->forwarding, nexthop, + sizeof(struct in6_addr)); + } else ospf6_route_add_nexthop(match, ifindex, NULL); match->path.origin.id = htonl(info->id); @@ -1515,9 +1519,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex, } info->type = type; - if (nexthop_num && nexthop) + if (nexthop_num && nexthop) { ospf6_route_add_nexthop(route, ifindex, nexthop); - else + if (!IN6_IS_ADDR_UNSPECIFIED(nexthop) + && !IN6_IS_ADDR_LINKLOCAL(nexthop)) + memcpy(&info->forwarding, nexthop, + sizeof(struct in6_addr)); + } else ospf6_route_add_nexthop(route, ifindex, NULL); route = ospf6_route_add(route, ospf6->external_table); diff --git a/ospf6d/ospf6_asbr.h b/ospf6d/ospf6_asbr.h index 15982ca64c..d63e467278 100644 --- a/ospf6d/ospf6_asbr.h +++ b/ospf6d/ospf6_asbr.h @@ -114,7 +114,7 @@ extern int ospf6_asbr_is_asbr(struct ospf6 *o); extern void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex, struct prefix *prefix, unsigned int nexthop_num, - struct in6_addr *nexthop, + const struct in6_addr *nexthop, route_tag_t tag, struct ospf6 *ospf6); extern void ospf6_asbr_redistribute_remove(int type, ifindex_t ifindex, struct prefix *prefix, diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 72dfa240af..443032933d 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -267,7 +267,8 @@ int ospf6_num_nexthops(struct list *nh_list) return (listcount(nh_list)); } -void ospf6_add_nexthop(struct list *nh_list, int ifindex, struct in6_addr *addr) +void ospf6_add_nexthop(struct list *nh_list, int ifindex, + const struct in6_addr *addr) { struct ospf6_nexthop *nh; struct ospf6_nexthop nh_match; diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index 2d4fcc930e..c2125951ec 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -312,7 +312,7 @@ extern int ospf6_num_nexthops(struct list *nh_list); extern void ospf6_copy_nexthops(struct list *dst, struct list *src); extern void ospf6_merge_nexthops(struct list *dst, struct list *src); extern void ospf6_add_nexthop(struct list *nh_list, int ifindex, - struct in6_addr *addr); + const struct in6_addr *addr); extern void ospf6_add_route_nexthop_blackhole(struct ospf6_route *route); extern int ospf6_num_nexthops(struct list *nh_list); extern bool ospf6_route_cmp_nexthops(struct ospf6_route *a, diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 6fe0a24926..0ccbb4d65d 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -252,7 +252,7 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS) { struct zapi_route api; unsigned long ifindex; - struct in6_addr *nexthop; + const struct in6_addr *nexthop = &in6addr_any; struct ospf6 *ospf6; struct prefix_ipv6 p; @@ -272,7 +272,9 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS) return 0; ifindex = api.nexthops[0].ifindex; - nexthop = &api.nexthops[0].gate.ipv6; + if (api.nexthops[0].type == NEXTHOP_TYPE_IPV6 + || api.nexthops[0].type == NEXTHOP_TYPE_IPV6_IFINDEX) + nexthop = &api.nexthops[0].gate.ipv6; if (IS_OSPF6_DEBUG_ZEBRA(RECV)) zlog_debug( |
