Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions bgpd/bgp_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,29 @@ bgp_dump_route_node_record(int afi, struct bgp_dest *dest,
+ BGP_DUMP_MSG_HEADER
+ BGP_DUMP_HEADER_SIZE) {
stream_set_endp(obuf, endp);
if (entry_count == 0) {
/* A single path's encoding exceeds the
* per-record cap. Skip it so the caller's
* while (path) loop makes forward progress.
*/
flog_warn(EC_BGP_DUMP,
"%s: skipping oversized path for %pFX from peer %s",
__func__, p, path->peer->host);
path = path->next;
}
break;
}

entry_count++;
endp = cur_endp;
}

/* Skip emitting a zero-entry record: some MRT parsers treat them as
* corrupt.
*/
if (entry_count == 0)
return path;

/* Overwrite the entry count, now that we know the right number */
stream_putw_at(obuf, sizep, entry_count);

Expand Down
Loading