mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 09:22:32 +00:00
bgpd: Convert remaining string output to our internal types
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
b58b399c5b
commit
c0d72166ee
@ -2133,19 +2133,11 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
|
|||||||
}
|
}
|
||||||
stream_get(&attr->mp_nexthop_local, s, IPV6_MAX_BYTELEN);
|
stream_get(&attr->mp_nexthop_local, s, IPV6_MAX_BYTELEN);
|
||||||
if (!IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local)) {
|
if (!IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local)) {
|
||||||
char buf1[INET6_ADDRSTRLEN];
|
|
||||||
char buf2[INET6_ADDRSTRLEN];
|
|
||||||
|
|
||||||
if (bgp_debug_update(peer, NULL, NULL, 1))
|
if (bgp_debug_update(peer, NULL, NULL, 1))
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s sent next-hops %s and %s. Ignoring non-LL value",
|
"%s sent next-hops %pI6 and %pI6. Ignoring non-LL value",
|
||||||
peer->host,
|
peer->host, &attr->mp_nexthop_global,
|
||||||
inet_ntop(AF_INET6,
|
&attr->mp_nexthop_local);
|
||||||
&attr->mp_nexthop_global,
|
|
||||||
buf1, INET6_ADDRSTRLEN),
|
|
||||||
inet_ntop(AF_INET6,
|
|
||||||
&attr->mp_nexthop_local, buf2,
|
|
||||||
INET6_ADDRSTRLEN));
|
|
||||||
|
|
||||||
attr->mp_nexthop_len = IPV6_MAX_BYTELEN;
|
attr->mp_nexthop_len = IPV6_MAX_BYTELEN;
|
||||||
}
|
}
|
||||||
@ -2344,16 +2336,10 @@ bgp_attr_ext_communities(struct bgp_attr_parser_args *args)
|
|||||||
|
|
||||||
/* Extract the Rmac, if any */
|
/* Extract the Rmac, if any */
|
||||||
if (bgp_attr_rmac(attr, &attr->rmac)) {
|
if (bgp_attr_rmac(attr, &attr->rmac)) {
|
||||||
if (bgp_debug_update(peer, NULL, NULL, 1) &&
|
if (bgp_debug_update(peer, NULL, NULL, 1)
|
||||||
bgp_mac_exist(&attr->rmac)) {
|
&& bgp_mac_exist(&attr->rmac))
|
||||||
char buf1[ETHER_ADDR_STRLEN];
|
zlog_debug("%s: router mac %pEA is self mac", __func__,
|
||||||
|
&attr->rmac);
|
||||||
zlog_debug("%s: router mac %s is self mac",
|
|
||||||
__func__,
|
|
||||||
prefix_mac2str(&attr->rmac, buf1,
|
|
||||||
sizeof(buf1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the tunnel type from encap extended community */
|
/* Get the tunnel type from encap extended community */
|
||||||
|
@ -592,9 +592,6 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,
|
|||||||
{
|
{
|
||||||
struct stream *s;
|
struct stream *s;
|
||||||
int ipa_len;
|
int ipa_len;
|
||||||
char buf1[ETHER_ADDR_STRLEN];
|
|
||||||
char buf2[INET6_ADDRSTRLEN];
|
|
||||||
char buf3[INET6_ADDRSTRLEN];
|
|
||||||
static struct in_addr zero_remote_vtep_ip;
|
static struct in_addr zero_remote_vtep_ip;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
@ -649,14 +646,10 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,
|
|||||||
|
|
||||||
if (bgp_debug_zebra(NULL))
|
if (bgp_debug_zebra(NULL))
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"Tx %s MACIP, VNI %u MAC %s IP %s flags 0x%x seq %u remote VTEP %s",
|
"Tx %s MACIP, VNI %u MAC %pEA IP %pIA flags 0x%x seq %u remote VTEP %pI4",
|
||||||
add ? "ADD" : "DEL", vpn->vni,
|
add ? "ADD" : "DEL", vpn->vni,
|
||||||
prefix_mac2str(&p->prefix.macip_addr.mac,
|
&p->prefix.macip_addr.mac, &p->prefix.macip_addr.ip,
|
||||||
buf1, sizeof(buf1)),
|
flags, seq, &remote_vtep_ip);
|
||||||
ipaddr2str(&p->prefix.macip_addr.ip,
|
|
||||||
buf3, sizeof(buf3)), flags, seq,
|
|
||||||
inet_ntop(AF_INET, &remote_vtep_ip, buf2,
|
|
||||||
sizeof(buf2)));
|
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(zclient);
|
||||||
}
|
}
|
||||||
@ -1319,16 +1312,11 @@ static int update_evpn_type5_route(struct bgp *bgp_vrf, struct prefix_evpn *evp,
|
|||||||
vrf_id_to_name(bgp_vrf->vrf_id), evp);
|
vrf_id_to_name(bgp_vrf->vrf_id), evp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bgp_debug_zebra(NULL)) {
|
if (bgp_debug_zebra(NULL))
|
||||||
char buf[ETHER_ADDR_STRLEN];
|
zlog_debug(
|
||||||
char buf2[INET6_ADDRSTRLEN];
|
"VRF %s type-5 route evp %pFX RMAC %pEA nexthop %pI4",
|
||||||
|
vrf_id_to_name(bgp_vrf->vrf_id), evp, &attr.rmac,
|
||||||
zlog_debug("VRF %s type-5 route evp %pFX RMAC %s nexthop %s",
|
&attr.nexthop);
|
||||||
vrf_id_to_name(bgp_vrf->vrf_id), evp,
|
|
||||||
prefix_mac2str(&attr.rmac, buf, sizeof(buf)),
|
|
||||||
inet_ntop(AF_INET, &attr.nexthop, buf2,
|
|
||||||
INET_ADDRSTRLEN));
|
|
||||||
}
|
|
||||||
|
|
||||||
attr.mp_nexthop_len = BGP_ATTR_NHLEN_IPV4;
|
attr.mp_nexthop_len = BGP_ATTR_NHLEN_IPV4;
|
||||||
|
|
||||||
@ -1725,16 +1713,13 @@ static int update_evpn_route(struct bgp *bgp, struct bgpevpn *vpn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bgp_debug_zebra(NULL)) {
|
if (bgp_debug_zebra(NULL)) {
|
||||||
char buf[ETHER_ADDR_STRLEN];
|
|
||||||
char buf3[ESI_STR_LEN];
|
char buf3[ESI_STR_LEN];
|
||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"VRF %s vni %u type-2 route evp %pFX RMAC %s nexthop %pI4 esi %s",
|
"VRF %s vni %u type-2 route evp %pFX RMAC %pEA nexthop %pI4 esi %s",
|
||||||
vpn->bgp_vrf ? vrf_id_to_name(vpn->bgp_vrf->vrf_id)
|
vpn->bgp_vrf ? vrf_id_to_name(vpn->bgp_vrf->vrf_id)
|
||||||
: " ",
|
: " ",
|
||||||
vpn->vni, p,
|
vpn->vni, p, &attr.rmac, &attr.mp_nexthop_global_in,
|
||||||
prefix_mac2str(&attr.rmac, buf, sizeof(buf)),
|
|
||||||
&attr.mp_nexthop_global_in,
|
|
||||||
esi_to_str(esi, buf3, sizeof(buf3)));
|
esi_to_str(esi, buf3, sizeof(buf3)));
|
||||||
}
|
}
|
||||||
/* router mac is only needed for type-2 routes here. */
|
/* router mac is only needed for type-2 routes here. */
|
||||||
@ -2004,16 +1989,13 @@ static void bgp_evpn_update_type2_route_entry(struct bgp *bgp,
|
|||||||
seq = mac_mobility_seqnum(local_pi->attr);
|
seq = mac_mobility_seqnum(local_pi->attr);
|
||||||
|
|
||||||
if (bgp_debug_zebra(NULL)) {
|
if (bgp_debug_zebra(NULL)) {
|
||||||
char buf[ETHER_ADDR_STRLEN];
|
|
||||||
char buf3[ESI_STR_LEN];
|
char buf3[ESI_STR_LEN];
|
||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"VRF %s vni %u evp %pFX RMAC %s nexthop %pI4 esi %s esf 0x%x from %s",
|
"VRF %s vni %u evp %pFX RMAC %pEA nexthop %pI4 esi %s esf 0x%x from %s",
|
||||||
vpn->bgp_vrf ? vrf_id_to_name(vpn->bgp_vrf->vrf_id)
|
vpn->bgp_vrf ? vrf_id_to_name(vpn->bgp_vrf->vrf_id)
|
||||||
: " ",
|
: " ",
|
||||||
vpn->vni, evp,
|
vpn->vni, evp, &attr.rmac, &attr.mp_nexthop_global_in,
|
||||||
prefix_mac2str(&attr.rmac, buf, sizeof(buf)),
|
|
||||||
&attr.mp_nexthop_global_in,
|
|
||||||
esi_to_str(&attr.esi, buf3, sizeof(buf3)),
|
esi_to_str(&attr.esi, buf3, sizeof(buf3)),
|
||||||
attr.es_flags, caller);
|
attr.es_flags, caller);
|
||||||
}
|
}
|
||||||
@ -5300,18 +5282,14 @@ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac,
|
|||||||
/* Create EVPN type-2 route and schedule for processing. */
|
/* Create EVPN type-2 route and schedule for processing. */
|
||||||
build_evpn_type2_prefix(&p, mac, ip);
|
build_evpn_type2_prefix(&p, mac, ip);
|
||||||
if (update_evpn_route(bgp, vpn, &p, flags, seq, esi)) {
|
if (update_evpn_route(bgp, vpn, &p, flags, seq, esi)) {
|
||||||
char buf[ETHER_ADDR_STRLEN];
|
|
||||||
char buf2[INET6_ADDRSTRLEN];
|
|
||||||
|
|
||||||
flog_err(
|
flog_err(
|
||||||
EC_BGP_EVPN_ROUTE_CREATE,
|
EC_BGP_EVPN_ROUTE_CREATE,
|
||||||
"%u:Failed to create Type-2 route, VNI %u %s MAC %s IP %s (flags: 0x%x)",
|
"%u:Failed to create Type-2 route, VNI %u %s MAC %pEA IP %pIA (flags: 0x%x)",
|
||||||
bgp->vrf_id, vpn->vni,
|
bgp->vrf_id, vpn->vni,
|
||||||
CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY)
|
CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY)
|
||||||
? "sticky gateway"
|
? "sticky gateway"
|
||||||
: "",
|
: "",
|
||||||
prefix_mac2str(mac, buf, sizeof(buf)),
|
mac, ip, flags);
|
||||||
ipaddr2str(ip, buf2, sizeof(buf2)), flags);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5396,23 +5374,16 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id,
|
|||||||
if (is_zero_mac(&bgp_vrf->evpn_info->pip_rmac_static))
|
if (is_zero_mac(&bgp_vrf->evpn_info->pip_rmac_static))
|
||||||
memcpy(&bgp_vrf->evpn_info->pip_rmac, svi_rmac, ETH_ALEN);
|
memcpy(&bgp_vrf->evpn_info->pip_rmac, svi_rmac, ETH_ALEN);
|
||||||
|
|
||||||
if (bgp_debug_zebra(NULL)) {
|
if (bgp_debug_zebra(NULL))
|
||||||
char buf[ETHER_ADDR_STRLEN];
|
zlog_debug(
|
||||||
char buf1[ETHER_ADDR_STRLEN];
|
"VRF %s vni %u pip %s RMAC %pEA sys RMAC %pEA static RMAC %pEA is_anycast_mac %s",
|
||||||
char buf2[ETHER_ADDR_STRLEN];
|
vrf_id_to_name(bgp_vrf->vrf_id), bgp_vrf->l3vni,
|
||||||
|
|
||||||
zlog_debug("VRF %s vni %u pip %s RMAC %s sys RMAC %s static RMAC %s is_anycast_mac %s",
|
|
||||||
vrf_id_to_name(bgp_vrf->vrf_id),
|
|
||||||
bgp_vrf->l3vni,
|
|
||||||
bgp_vrf->evpn_info->advertise_pip ? "enable"
|
bgp_vrf->evpn_info->advertise_pip ? "enable"
|
||||||
: "disable",
|
: "disable",
|
||||||
prefix_mac2str(&bgp_vrf->rmac, buf, sizeof(buf)),
|
&bgp_vrf->rmac, &bgp_vrf->evpn_info->pip_rmac,
|
||||||
prefix_mac2str(&bgp_vrf->evpn_info->pip_rmac,
|
&bgp_vrf->evpn_info->pip_rmac_static,
|
||||||
buf1, sizeof(buf1)),
|
|
||||||
prefix_mac2str(&bgp_vrf->evpn_info->pip_rmac_static,
|
|
||||||
buf2, sizeof(buf2)),
|
|
||||||
is_anycast_mac ? "Enable" : "Disable");
|
is_anycast_mac ? "Enable" : "Disable");
|
||||||
}
|
|
||||||
/* set the right filter - are we using l3vni only for prefix routes? */
|
/* set the right filter - are we using l3vni only for prefix routes? */
|
||||||
if (filter) {
|
if (filter) {
|
||||||
SET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY);
|
SET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY);
|
||||||
|
@ -1556,13 +1556,9 @@ static int bgp_connect_success(struct peer *peer)
|
|||||||
bgp_reads_on(peer);
|
bgp_reads_on(peer);
|
||||||
|
|
||||||
if (bgp_debug_neighbor_events(peer)) {
|
if (bgp_debug_neighbor_events(peer)) {
|
||||||
char buf1[SU_ADDRSTRLEN];
|
|
||||||
|
|
||||||
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER))
|
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER))
|
||||||
zlog_debug("%s open active, local address %s",
|
zlog_debug("%s open active, local address %pSU",
|
||||||
peer->host,
|
peer->host, peer->su_local);
|
||||||
sockunion2str(peer->su_local, buf1,
|
|
||||||
SU_ADDRSTRLEN));
|
|
||||||
else
|
else
|
||||||
zlog_debug("%s passive open", peer->host);
|
zlog_debug("%s passive open", peer->host);
|
||||||
}
|
}
|
||||||
@ -1598,13 +1594,9 @@ static int bgp_connect_success_w_delayopen(struct peer *peer)
|
|||||||
bgp_reads_on(peer);
|
bgp_reads_on(peer);
|
||||||
|
|
||||||
if (bgp_debug_neighbor_events(peer)) {
|
if (bgp_debug_neighbor_events(peer)) {
|
||||||
char buf1[SU_ADDRSTRLEN];
|
|
||||||
|
|
||||||
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER))
|
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER))
|
||||||
zlog_debug("%s open active, local address %s",
|
zlog_debug("%s open active, local address %pSU",
|
||||||
peer->host,
|
peer->host, peer->su_local);
|
||||||
sockunion2str(peer->su_local, buf1,
|
|
||||||
SU_ADDRSTRLEN));
|
|
||||||
else
|
else
|
||||||
zlog_debug("%s passive open", peer->host);
|
zlog_debug("%s passive open", peer->host);
|
||||||
}
|
}
|
||||||
|
@ -420,27 +420,19 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
|
|||||||
/* Check address. */
|
/* Check address. */
|
||||||
if (afi == AFI_IP6 && safi == SAFI_LABELED_UNICAST) {
|
if (afi == AFI_IP6 && safi == SAFI_LABELED_UNICAST) {
|
||||||
if (IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)) {
|
if (IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)) {
|
||||||
char buf[BUFSIZ];
|
|
||||||
|
|
||||||
flog_err(
|
flog_err(
|
||||||
EC_BGP_UPDATE_RCV,
|
EC_BGP_UPDATE_RCV,
|
||||||
"%s: IPv6 labeled-unicast NLRI is link-local address %s, ignoring",
|
"%s: IPv6 labeled-unicast NLRI is link-local address %pI6, ignoring",
|
||||||
peer->host,
|
peer->host, &p.u.prefix6);
|
||||||
inet_ntop(AF_INET6, &p.u.prefix6, buf,
|
|
||||||
BUFSIZ));
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IN6_IS_ADDR_MULTICAST(&p.u.prefix6)) {
|
if (IN6_IS_ADDR_MULTICAST(&p.u.prefix6)) {
|
||||||
char buf[BUFSIZ];
|
|
||||||
|
|
||||||
flog_err(
|
flog_err(
|
||||||
EC_BGP_UPDATE_RCV,
|
EC_BGP_UPDATE_RCV,
|
||||||
"%s: IPv6 unicast NLRI is multicast address %s, ignoring",
|
"%s: IPv6 unicast NLRI is multicast address %pI6, ignoring",
|
||||||
peer->host,
|
peer->host, &p.u.prefix6);
|
||||||
inet_ntop(AF_INET6, &p.u.prefix6, buf,
|
|
||||||
BUFSIZ));
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -519,7 +519,6 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
|
|||||||
struct listnode *mp_node, *mp_next_node;
|
struct listnode *mp_node, *mp_next_node;
|
||||||
struct bgp_path_info *cur_mpath, *new_mpath, *next_mpath, *prev_mpath;
|
struct bgp_path_info *cur_mpath, *new_mpath, *next_mpath, *prev_mpath;
|
||||||
int mpath_changed, debug;
|
int mpath_changed, debug;
|
||||||
char nh_buf[2][INET6_ADDRSTRLEN];
|
|
||||||
bool all_paths_lb;
|
bool all_paths_lb;
|
||||||
char path_buf[PATH_ADDPATH_STR_BUFFER];
|
char path_buf[PATH_ADDPATH_STR_BUFFER];
|
||||||
|
|
||||||
@ -630,14 +629,10 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
|
|||||||
cur_mpath, path_buf,
|
cur_mpath, path_buf,
|
||||||
sizeof(path_buf));
|
sizeof(path_buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%pRN: remove mpath %s nexthop %s, cur count %d",
|
"%pRN: remove mpath %s nexthop %pI4, cur count %d",
|
||||||
bgp_dest_to_rnode(dest),
|
bgp_dest_to_rnode(dest),
|
||||||
path_buf,
|
path_buf,
|
||||||
inet_ntop(AF_INET,
|
&cur_mpath->attr->nexthop,
|
||||||
&cur_mpath->attr
|
|
||||||
->nexthop,
|
|
||||||
nh_buf[0],
|
|
||||||
sizeof(nh_buf[0])),
|
|
||||||
mpath_count);
|
mpath_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -664,12 +659,9 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
|
|||||||
bgp_path_info_path_with_addpath_rx_str(
|
bgp_path_info_path_with_addpath_rx_str(
|
||||||
cur_mpath, path_buf, sizeof(path_buf));
|
cur_mpath, path_buf, sizeof(path_buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%pRN: remove mpath %s nexthop %s, cur count %d",
|
"%pRN: remove mpath %s nexthop %pI4, cur count %d",
|
||||||
bgp_dest_to_rnode(dest), path_buf,
|
bgp_dest_to_rnode(dest), path_buf,
|
||||||
inet_ntop(AF_INET,
|
&cur_mpath->attr->nexthop, mpath_count);
|
||||||
&cur_mpath->attr->nexthop,
|
|
||||||
nh_buf[0], sizeof(nh_buf[0])),
|
|
||||||
mpath_count);
|
|
||||||
}
|
}
|
||||||
cur_mpath = next_mpath;
|
cur_mpath = next_mpath;
|
||||||
} else {
|
} else {
|
||||||
@ -715,14 +707,10 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
|
|||||||
new_mpath, path_buf,
|
new_mpath, path_buf,
|
||||||
sizeof(path_buf));
|
sizeof(path_buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%pRN: add mpath %s nexthop %s, cur count %d",
|
"%pRN: add mpath %s nexthop %pI4, cur count %d",
|
||||||
bgp_dest_to_rnode(dest),
|
bgp_dest_to_rnode(dest),
|
||||||
path_buf,
|
path_buf,
|
||||||
inet_ntop(AF_INET,
|
&new_mpath->attr->nexthop,
|
||||||
&new_mpath->attr
|
|
||||||
->nexthop,
|
|
||||||
nh_buf[0],
|
|
||||||
sizeof(nh_buf[0])),
|
|
||||||
mpath_count);
|
mpath_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,6 @@ int bgp_md5_unset(struct peer *peer)
|
|||||||
|
|
||||||
int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
|
int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
|
||||||
{
|
{
|
||||||
char buf[INET_ADDRSTRLEN];
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* In case of peer is EBGP, we should set TTL for this connection. */
|
/* In case of peer is EBGP, we should set TTL for this connection. */
|
||||||
@ -242,11 +241,8 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
flog_err(
|
flog_err(
|
||||||
EC_LIB_SOCKET,
|
EC_LIB_SOCKET,
|
||||||
"%s: Can't set TxTTL on peer (rtrid %s) socket, err = %d",
|
"%s: Can't set TxTTL on peer (rtrid %pI4) socket, err = %d",
|
||||||
__func__,
|
__func__, &peer->remote_id, errno);
|
||||||
inet_ntop(AF_INET, &peer->remote_id, buf,
|
|
||||||
sizeof(buf)),
|
|
||||||
errno);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else if (peer->gtsm_hops) {
|
} else if (peer->gtsm_hops) {
|
||||||
@ -258,11 +254,8 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
flog_err(
|
flog_err(
|
||||||
EC_LIB_SOCKET,
|
EC_LIB_SOCKET,
|
||||||
"%s: Can't set TxTTL on peer (rtrid %s) socket, err = %d",
|
"%s: Can't set TxTTL on peer (rtrid %pI4) socket, err = %d",
|
||||||
__func__,
|
__func__, &peer->remote_id, errno);
|
||||||
inet_ntop(AF_INET, &peer->remote_id, buf,
|
|
||||||
sizeof(buf)),
|
|
||||||
errno);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret = sockopt_minttl(peer->su.sa.sa_family, bgp_sock,
|
ret = sockopt_minttl(peer->su.sa.sa_family, bgp_sock,
|
||||||
@ -270,11 +263,8 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
flog_err(
|
flog_err(
|
||||||
EC_LIB_SOCKET,
|
EC_LIB_SOCKET,
|
||||||
"%s: Can't set MinTTL on peer (rtrid %s) socket, err = %d",
|
"%s: Can't set MinTTL on peer (rtrid %pI4) socket, err = %d",
|
||||||
__func__,
|
__func__, &peer->remote_id, errno);
|
||||||
inet_ntop(AF_INET, &peer->remote_id, buf,
|
|
||||||
sizeof(buf)),
|
|
||||||
errno);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5255,26 +5255,18 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
|
|||||||
/* Check address. */
|
/* Check address. */
|
||||||
if (afi == AFI_IP6 && safi == SAFI_UNICAST) {
|
if (afi == AFI_IP6 && safi == SAFI_UNICAST) {
|
||||||
if (IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)) {
|
if (IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)) {
|
||||||
char buf[BUFSIZ];
|
|
||||||
|
|
||||||
flog_err(
|
flog_err(
|
||||||
EC_BGP_UPDATE_RCV,
|
EC_BGP_UPDATE_RCV,
|
||||||
"%s: IPv6 unicast NLRI is link-local address %s, ignoring",
|
"%s: IPv6 unicast NLRI is link-local address %pI6, ignoring",
|
||||||
peer->host,
|
peer->host, &p.u.prefix6);
|
||||||
inet_ntop(AF_INET6, &p.u.prefix6, buf,
|
|
||||||
BUFSIZ));
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (IN6_IS_ADDR_MULTICAST(&p.u.prefix6)) {
|
if (IN6_IS_ADDR_MULTICAST(&p.u.prefix6)) {
|
||||||
char buf[BUFSIZ];
|
|
||||||
|
|
||||||
flog_err(
|
flog_err(
|
||||||
EC_BGP_UPDATE_RCV,
|
EC_BGP_UPDATE_RCV,
|
||||||
"%s: IPv6 unicast NLRI is multicast address %s, ignoring",
|
"%s: IPv6 unicast NLRI is multicast address %pI6, ignoring",
|
||||||
peer->host,
|
peer->host, &p.u.prefix6);
|
||||||
inet_ntop(AF_INET6, &p.u.prefix6, buf,
|
|
||||||
BUFSIZ));
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -350,8 +350,6 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
|
|||||||
struct stream *s = NULL;
|
struct stream *s = NULL;
|
||||||
bpacket_attr_vec *vec;
|
bpacket_attr_vec *vec;
|
||||||
struct peer *peer;
|
struct peer *peer;
|
||||||
char buf[BUFSIZ];
|
|
||||||
char buf2[BUFSIZ];
|
|
||||||
struct bgp_filter *filter;
|
struct bgp_filter *filter;
|
||||||
|
|
||||||
s = stream_dup(pkt->buffer);
|
s = stream_dup(pkt->buffer);
|
||||||
@ -568,22 +566,21 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
|
|||||||
if (nhlen == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL
|
if (nhlen == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL
|
||||||
|| nhlen == BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL)
|
|| nhlen == BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"u%" PRIu64 ":s%" PRIu64" %s send UPDATE w/ mp_nexthops %s, %s%s",
|
"u%" PRIu64 ":s%" PRIu64
|
||||||
|
" %s send UPDATE w/ mp_nexthops %pI6, %pI6%s",
|
||||||
PAF_SUBGRP(paf)->update_group->id,
|
PAF_SUBGRP(paf)->update_group->id,
|
||||||
PAF_SUBGRP(paf)->id, peer->host,
|
PAF_SUBGRP(paf)->id, peer->host,
|
||||||
inet_ntop(AF_INET6, mod_v6nhg, buf,
|
mod_v6nhg, mod_v6nhl,
|
||||||
BUFSIZ),
|
|
||||||
inet_ntop(AF_INET6, mod_v6nhl, buf2,
|
|
||||||
BUFSIZ),
|
|
||||||
(nhlen == BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL
|
(nhlen == BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL
|
||||||
? " and RD"
|
? " and RD"
|
||||||
: ""));
|
: ""));
|
||||||
else
|
else
|
||||||
zlog_debug("u%" PRIu64 ":s%" PRIu64" %s send UPDATE w/ mp_nexthop %s%s",
|
zlog_debug(
|
||||||
|
"u%" PRIu64 ":s%" PRIu64
|
||||||
|
" %s send UPDATE w/ mp_nexthop %pI6%s",
|
||||||
PAF_SUBGRP(paf)->update_group->id,
|
PAF_SUBGRP(paf)->update_group->id,
|
||||||
PAF_SUBGRP(paf)->id, peer->host,
|
PAF_SUBGRP(paf)->id, peer->host,
|
||||||
inet_ntop(AF_INET6, mod_v6nhg, buf,
|
mod_v6nhg,
|
||||||
BUFSIZ),
|
|
||||||
(nhlen == BGP_ATTR_NHLEN_VPNV6_GLOBAL
|
(nhlen == BGP_ATTR_NHLEN_VPNV6_GLOBAL
|
||||||
? " and RD"
|
? " and RD"
|
||||||
: ""));
|
: ""));
|
||||||
|
@ -942,12 +942,9 @@ static bool bgp_table_map_apply(struct route_map *map, const struct prefix *p,
|
|||||||
|
|
||||||
if (bgp_debug_zebra(p)) {
|
if (bgp_debug_zebra(p)) {
|
||||||
if (p->family == AF_INET) {
|
if (p->family == AF_INET) {
|
||||||
char buf[2][INET_ADDRSTRLEN];
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"Zebra rmap deny: IPv4 route %pFX nexthop %s",
|
"Zebra rmap deny: IPv4 route %pFX nexthop %pI4",
|
||||||
p,
|
p, &path->attr->nexthop);
|
||||||
inet_ntop(AF_INET, &path->attr->nexthop, buf[1],
|
|
||||||
sizeof(buf[1])));
|
|
||||||
}
|
}
|
||||||
if (p->family == AF_INET6) {
|
if (p->family == AF_INET6) {
|
||||||
char buf[2][INET6_ADDRSTRLEN];
|
char buf[2][INET6_ADDRSTRLEN];
|
||||||
@ -2742,14 +2739,12 @@ static int bgp_zebra_process_local_es_evi(ZAPI_CALLBACK_ARGS)
|
|||||||
static int bgp_zebra_process_local_l3vni(ZAPI_CALLBACK_ARGS)
|
static int bgp_zebra_process_local_l3vni(ZAPI_CALLBACK_ARGS)
|
||||||
{
|
{
|
||||||
int filter = 0;
|
int filter = 0;
|
||||||
char buf[ETHER_ADDR_STRLEN];
|
|
||||||
vni_t l3vni = 0;
|
vni_t l3vni = 0;
|
||||||
struct ethaddr svi_rmac, vrr_rmac = {.octet = {0} };
|
struct ethaddr svi_rmac, vrr_rmac = {.octet = {0} };
|
||||||
struct in_addr originator_ip;
|
struct in_addr originator_ip;
|
||||||
struct stream *s;
|
struct stream *s;
|
||||||
ifindex_t svi_ifindex;
|
ifindex_t svi_ifindex;
|
||||||
bool is_anycast_mac = false;
|
bool is_anycast_mac = false;
|
||||||
char buf1[ETHER_ADDR_STRLEN];
|
|
||||||
|
|
||||||
memset(&svi_rmac, 0, sizeof(struct ethaddr));
|
memset(&svi_rmac, 0, sizeof(struct ethaddr));
|
||||||
memset(&originator_ip, 0, sizeof(struct in_addr));
|
memset(&originator_ip, 0, sizeof(struct in_addr));
|
||||||
@ -2764,11 +2759,10 @@ static int bgp_zebra_process_local_l3vni(ZAPI_CALLBACK_ARGS)
|
|||||||
is_anycast_mac = stream_getl(s);
|
is_anycast_mac = stream_getl(s);
|
||||||
|
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("Rx L3-VNI ADD VRF %s VNI %u RMAC svi-mac %s vrr-mac %s filter %s svi-if %u",
|
zlog_debug(
|
||||||
vrf_id_to_name(vrf_id), l3vni,
|
"Rx L3-VNI ADD VRF %s VNI %u RMAC svi-mac %pEA vrr-mac %pEA filter %s svi-if %u",
|
||||||
prefix_mac2str(&svi_rmac, buf, sizeof(buf)),
|
vrf_id_to_name(vrf_id), l3vni, &svi_rmac,
|
||||||
prefix_mac2str(&vrr_rmac, buf1,
|
&vrr_rmac,
|
||||||
sizeof(buf1)),
|
|
||||||
filter ? "prefix-routes-only" : "none",
|
filter ? "prefix-routes-only" : "none",
|
||||||
svi_ifindex);
|
svi_ifindex);
|
||||||
|
|
||||||
@ -2830,8 +2824,6 @@ static int bgp_zebra_process_local_macip(ZAPI_CALLBACK_ARGS)
|
|||||||
struct ethaddr mac;
|
struct ethaddr mac;
|
||||||
struct ipaddr ip;
|
struct ipaddr ip;
|
||||||
int ipa_len;
|
int ipa_len;
|
||||||
char buf[ETHER_ADDR_STRLEN];
|
|
||||||
char buf1[INET6_ADDRSTRLEN];
|
|
||||||
uint8_t flags = 0;
|
uint8_t flags = 0;
|
||||||
uint32_t seqnum = 0;
|
uint32_t seqnum = 0;
|
||||||
int state = 0;
|
int state = 0;
|
||||||
@ -2871,11 +2863,11 @@ static int bgp_zebra_process_local_macip(ZAPI_CALLBACK_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%u:Recv MACIP %s f 0x%x MAC %s IP %s VNI %u seq %u state %d ESI %s",
|
zlog_debug(
|
||||||
vrf_id, (cmd == ZEBRA_MACIP_ADD) ? "Add" : "Del",
|
"%u:Recv MACIP %s f 0x%x MAC %pEA IP %pI4 VNI %u seq %u state %d ESI %s",
|
||||||
flags, prefix_mac2str(&mac, buf, sizeof(buf)),
|
vrf_id, (cmd == ZEBRA_MACIP_ADD) ? "Add" : "Del", flags,
|
||||||
ipaddr2str(&ip, buf1, sizeof(buf1)), vni, seqnum,
|
&mac, &ip, vni, seqnum, state,
|
||||||
state, esi_to_str(&esi, buf2, sizeof(buf2)));
|
esi_to_str(&esi, buf2, sizeof(buf2)));
|
||||||
|
|
||||||
if (cmd == ZEBRA_MACIP_ADD)
|
if (cmd == ZEBRA_MACIP_ADD)
|
||||||
return bgp_evpn_local_macip_add(bgp, vni, &mac, &ip,
|
return bgp_evpn_local_macip_add(bgp, vni, &mac, &ip,
|
||||||
|
Loading…
Reference in New Issue
Block a user