if (bgp_debug_update(peer, NULL, NULL, 0))
zlog_debug("u%" PRIu64 ":s%" PRIu64
- " %s send UPDATE w/ nexthop %s%s",
+ " %s send UPDATE w/ nexthop %pI4%s",
PAF_SUBGRP(paf)->update_group->id,
- PAF_SUBGRP(paf)->id, peer->host,
- inet_ntoa(*mod_v4nh),
+ PAF_SUBGRP(paf)->id, peer->host, mod_v4nh,
(nhlen == BGP_ATTR_NHLEN_VPNV4 ? " and RD"
: ""));
} else if (nhafi == AFI_IP6) {
gnh_modified = 1;
}
+ if (IN6_IS_ADDR_UNSPECIFIED(mod_v6nhg)) {
+ if (peer->nexthop.v4.s_addr) {
+ ipv4_to_ipv4_mapped_ipv6(mod_v6nhg,
+ peer->nexthop.v4);
+ }
+ }
+
+ if (IS_MAPPED_IPV6(&peer->nexthop.v6_global)) {
+ mod_v6nhg = &peer->nexthop.v6_global;
+ gnh_modified = 1;
+ }
+
if (nhlen == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL
|| nhlen == BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL) {
stream_get_from(&v6nhlocal, s, offset_nhlocal,
if (nhlen == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL
|| nhlen == BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL)
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 %s, %s%s",
PAF_SUBGRP(paf)->update_group->id,
PAF_SUBGRP(paf)->id, peer->host,
inet_ntop(AF_INET6, mod_v6nhg, buf,
? " and RD"
: ""));
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 %s%s",
PAF_SUBGRP(paf)->update_group->id,
PAF_SUBGRP(paf)->id, peer->host,
inet_ntop(AF_INET6, mod_v6nhg, buf,
if (bgp_debug_update(peer, NULL, NULL, 0))
zlog_debug("u%" PRIu64 ":s%" PRIu64
- " %s send UPDATE w/ nexthop %s",
+ " %s send UPDATE w/ nexthop %pI4",
PAF_SUBGRP(paf)->update_group->id,
- PAF_SUBGRP(paf)->id, peer->host,
- inet_ntoa(*mod_v4nh));
+ PAF_SUBGRP(paf)->id, peer->host, mod_v4nh);
}
return s;
if (BGP_DEBUG(update, UPDATE_OUT)
|| BGP_DEBUG(update, UPDATE_PREFIX)) {
zlog_debug(
- "%s reached maximum prefix to be send (%" PRIu32
- ")",
+ "%s reached maximum prefix to be send (%u)",
peer->host, peer->pmax_out[afi][safi]);
}
goto next;
if (space_remaining < space_needed) {
flog_err(
EC_BGP_UPDGRP_ATTR_LEN,
- "u%" PRIu64 ":s%" PRIu64
- " attributes too long, cannot send UPDATE",
+ "u%" PRIu64 ":s%" PRIu64" attributes too long, cannot send UPDATE",
subgrp->update_group->id, subgrp->id);
/* Flush the FIFO update queue */
memset(send_attr_str, 0, BUFSIZ);
send_attr_printed = 0;
bgp_dump_attr(adv->baa->attr, send_attr_str,
- BUFSIZ);
+ sizeof(send_attr_str));
}
}
char pfx_buf[BGP_PRD_PATH_STRLEN];
if (!send_attr_printed) {
- zlog_debug("u%" PRIu64 ":s%" PRIu64
- " send UPDATE w/ attr: %s",
+ zlog_debug("u%" PRIu64 ":s%" PRIu64" send UPDATE w/ attr: %s",
subgrp->update_group->id, subgrp->id,
send_attr_str);
if (!stream_empty(snlri)) {
pkt_afi = afi_int2iana(afi);
pkt_safi = safi_int2iana(safi);
zlog_debug(
- "u%" PRIu64 ":s%" PRIu64
- " send MP_REACH for afi/safi %d/%d",
+ "u%" PRIu64 ":s%" PRIu64" send MP_REACH for afi/safi %d/%d",
subgrp->update_group->id,
subgrp->id, pkt_afi, pkt_safi);
}
packet = stream_dup(s);
bgp_packet_set_size(packet);
if (bgp_debug_update(NULL, NULL, subgrp->update_group, 0))
- zlog_debug("u%" PRIu64 ":s%" PRIu64
- " send UPDATE len %zd numpfx %d",
+ zlog_debug("u%" PRIu64 ":s%" PRIu64" send UPDATE len %zd numpfx %d",
subgrp->update_group->id, subgrp->id,
(stream_get_endp(packet)
- stream_get_getp(packet)),
if (bgp_debug_update(NULL, NULL,
subgrp->update_group, 0))
zlog_debug(
- "u%" PRIu64 ":s%" PRIu64
- " send MP_UNREACH for afi/safi %d/%d",
+ "u%" PRIu64 ":s%" PRIu64" send MP_UNREACH for afi/safi %d/%d",
subgrp->update_group->id,
subgrp->id, pkt_afi, pkt_safi);
}
bgp_debug_rdpfxpath2str(afi, safi, prd, dest_p, NULL, 0,
addpath_encode, addpath_tx_id,
pfx_buf, sizeof(pfx_buf));
- zlog_debug("u%" PRIu64 ":s%" PRIu64
- " send UPDATE %s -- unreachable",
+ zlog_debug("u%" PRIu64 ":s%" PRIu64" send UPDATE %s -- unreachable",
subgrp->update_group->id, subgrp->id,
pfx_buf);
}
}
bgp_packet_set_size(s);
if (bgp_debug_update(NULL, NULL, subgrp->update_group, 0))
- zlog_debug("u%" PRIu64 ":s%" PRIu64
- " send UPDATE (withdraw) len %zd numpfx %d",
+ zlog_debug("u%" PRIu64 ":s%" PRIu64" send UPDATE (withdraw) len %zd numpfx %d",
subgrp->update_group->id, subgrp->id,
(stream_get_endp(s) - stream_get_getp(s)),
num_pfx);
/* Logging the attribute. */
if (bgp_debug_update(NULL, &p, subgrp->update_group, 0)) {
char attrstr[BUFSIZ];
- char buf[PREFIX_STRLEN];
/* ' with addpath ID ' 17
* max strlen of uint32 + 10
* +/- (just in case) + 1
attrstr[0] = '\0';
- bgp_dump_attr(attr, attrstr, BUFSIZ);
+ bgp_dump_attr(attr, attrstr, sizeof(attrstr));
if (addpath_encode)
snprintf(tx_id_buf, sizeof(tx_id_buf),
else
tx_id_buf[0] = '\0';
- zlog_debug("u%" PRIu64 ":s%" PRIu64 " send UPDATE %s%s %s",
- (SUBGRP_UPDGRP(subgrp))->id, subgrp->id,
- prefix2str(&p, buf, sizeof(buf)), tx_id_buf,
- attrstr);
+ zlog_debug("u%" PRIu64 ":s%" PRIu64 " send UPDATE %pFX%s %s",
+ (SUBGRP_UPDGRP(subgrp))->id, subgrp->id, &p,
+ tx_id_buf, attrstr);
}
s = stream_new(BGP_MAX_PACKET_SIZE);
p.prefixlen = 0;
if (bgp_debug_update(NULL, &p, subgrp->update_group, 0)) {
- char buf[PREFIX_STRLEN];
/* ' with addpath ID ' 17
* max strlen of uint32 + 10
* +/- (just in case) + 1
BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE);
zlog_debug("u%" PRIu64 ":s%" PRIu64
- " send UPDATE %s%s -- unreachable",
- (SUBGRP_UPDGRP(subgrp))->id, subgrp->id,
- prefix2str(&p, buf, sizeof(buf)), tx_id_buf);
+ " send UPDATE %pFX%s -- unreachable",
+ (SUBGRP_UPDGRP(subgrp))->id, subgrp->id, &p,
+ tx_id_buf);
}
s = stream_new(BGP_MAX_PACKET_SIZE);