mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 11:25:41 +00:00
Merge branch 'master' into nhrp_bugfix
This commit is contained in:
commit
31384f929a
6
.gitignore
vendored
6
.gitignore
vendored
@ -56,6 +56,12 @@
|
|||||||
*.pb.cc
|
*.pb.cc
|
||||||
*_clippy.c
|
*_clippy.c
|
||||||
|
|
||||||
|
### gcov outputs
|
||||||
|
|
||||||
|
*.gcno
|
||||||
|
*.gcov
|
||||||
|
*.gcda
|
||||||
|
|
||||||
### dist
|
### dist
|
||||||
|
|
||||||
*.tar.?z
|
*.tar.?z
|
||||||
|
@ -138,7 +138,7 @@ babel_create_routing_process (void)
|
|||||||
assert (babel_routing_process == NULL);
|
assert (babel_routing_process == NULL);
|
||||||
|
|
||||||
/* Allocaste Babel instance. */
|
/* Allocaste Babel instance. */
|
||||||
babel_routing_process = XCALLOC (MTYPE_BABEL, sizeof (struct babel));
|
babel_routing_process = XCALLOC(MTYPE_BABEL, sizeof(struct babel));
|
||||||
|
|
||||||
/* Initialize timeouts */
|
/* Initialize timeouts */
|
||||||
gettime(&babel_now);
|
gettime(&babel_now);
|
||||||
|
@ -122,7 +122,7 @@ void uchar_to_inaddr(struct in_addr *dest, const unsigned char *src);
|
|||||||
void in6addr_to_uchar(unsigned char *dest, const struct in6_addr *src);
|
void in6addr_to_uchar(unsigned char *dest, const struct in6_addr *src);
|
||||||
void uchar_to_in6addr(struct in6_addr *dest, const unsigned char *src);
|
void uchar_to_in6addr(struct in6_addr *dest, const unsigned char *src);
|
||||||
int daemonise(void);
|
int daemonise(void);
|
||||||
const unsigned char v4prefix[16];
|
extern const unsigned char v4prefix[16];
|
||||||
|
|
||||||
/* If debugging is disabled, we want to avoid calling format_address
|
/* If debugging is disabled, we want to avoid calling format_address
|
||||||
for every omitted debugging message. So debug is a macro. But
|
for every omitted debugging message. So debug is a macro. But
|
||||||
|
@ -383,7 +383,7 @@ int bfdd_bfd_sessions_single_hop_administrative_down_modify(
|
|||||||
|
|
||||||
bs = nb_running_get_entry(dnode, NULL, true);
|
bs = nb_running_get_entry(dnode, NULL, true);
|
||||||
|
|
||||||
if (shutdown == false) {
|
if (!shutdown) {
|
||||||
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_SHUTDOWN))
|
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_SHUTDOWN))
|
||||||
return NB_OK;
|
return NB_OK;
|
||||||
|
|
||||||
@ -447,7 +447,7 @@ int bfdd_bfd_sessions_single_hop_echo_mode_modify(enum nb_event event,
|
|||||||
|
|
||||||
bs = nb_running_get_entry(dnode, NULL, true);
|
bs = nb_running_get_entry(dnode, NULL, true);
|
||||||
|
|
||||||
if (echo == false) {
|
if (!echo) {
|
||||||
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))
|
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))
|
||||||
return NB_OK;
|
return NB_OK;
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ static void _display_peer_brief(struct vty *vty, struct bfd_session *bs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _display_peer_brief_iter(struct hash_backet *hb, void *arg)
|
static void _display_peer_brief_iter(struct hash_bucket *hb, void *arg)
|
||||||
{
|
{
|
||||||
struct bfd_vrf_tuple *bvt = arg;
|
struct bfd_vrf_tuple *bvt = arg;
|
||||||
struct vty *vty;
|
struct vty *vty;
|
||||||
@ -500,7 +500,7 @@ static void _display_peers_brief(struct vty *vty, const char *vrfname, bool use_
|
|||||||
|
|
||||||
bvt.vrfname = vrfname;
|
bvt.vrfname = vrfname;
|
||||||
|
|
||||||
if (use_json == false) {
|
if (!use_json) {
|
||||||
bvt.vty = vty;
|
bvt.vty = vty;
|
||||||
|
|
||||||
vty_out(vty, "Session count: %lu\n", bfd_get_session_count());
|
vty_out(vty, "Session count: %lu\n", bfd_get_session_count());
|
||||||
|
@ -41,9 +41,9 @@
|
|||||||
#define AS_HEADER_SIZE 2
|
#define AS_HEADER_SIZE 2
|
||||||
|
|
||||||
/* Now FOUR octets are used for AS value. */
|
/* Now FOUR octets are used for AS value. */
|
||||||
#define AS_VALUE_SIZE sizeof (as_t)
|
#define AS_VALUE_SIZE sizeof(as_t)
|
||||||
/* This is the old one */
|
/* This is the old one */
|
||||||
#define AS16_VALUE_SIZE sizeof (as16_t)
|
#define AS16_VALUE_SIZE sizeof(as16_t)
|
||||||
|
|
||||||
/* Maximum protocol segment length value */
|
/* Maximum protocol segment length value */
|
||||||
#define AS_SEGMENT_MAX 255
|
#define AS_SEGMENT_MAX 255
|
||||||
@ -768,7 +768,7 @@ static int assegments_parse(struct stream *s, size_t length,
|
|||||||
* on more, than 8 bits (otherwise it's a warning, bug
|
* on more, than 8 bits (otherwise it's a warning, bug
|
||||||
* #564).
|
* #564).
|
||||||
*/
|
*/
|
||||||
|| ((sizeof segh.length > 1)
|
|| ((sizeof(segh.length) > 1)
|
||||||
&& (0x10 + segh.length > 0x10 + AS_SEGMENT_MAX))) {
|
&& (0x10 + segh.length > 0x10 + AS_SEGMENT_MAX))) {
|
||||||
if (head)
|
if (head)
|
||||||
assegment_free_all(head);
|
assegment_free_all(head);
|
||||||
@ -793,7 +793,7 @@ static int assegments_parse(struct stream *s, size_t length,
|
|||||||
if (head)
|
if (head)
|
||||||
prev->next = seg;
|
prev->next = seg;
|
||||||
else /* it's the first segment */
|
else /* it's the first segment */
|
||||||
head = prev = seg;
|
head = seg;
|
||||||
|
|
||||||
for (i = 0; i < segh.length; i++)
|
for (i = 0; i < segh.length; i++)
|
||||||
seg->as[i] =
|
seg->as[i] =
|
||||||
@ -2127,7 +2127,7 @@ static void *bgp_aggr_aspath_hash_alloc(void *p)
|
|||||||
return aspath;
|
return aspath;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_aggr_aspath_prepare(struct hash_backet *hb, void *arg)
|
static void bgp_aggr_aspath_prepare(struct hash_bucket *hb, void *arg)
|
||||||
{
|
{
|
||||||
struct aspath *hb_aspath = hb->data;
|
struct aspath *hb_aspath = hb->data;
|
||||||
struct aspath **aggr_aspath = arg;
|
struct aspath **aggr_aspath = arg;
|
||||||
|
@ -2506,9 +2506,14 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(uint8_t type, uint16_t length,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Configure from Info */
|
/* Configure from Info */
|
||||||
attr->srv6_vpn = XMALLOC(MTYPE_BGP_SRV6_VPN,
|
if (attr->srv6_vpn) {
|
||||||
|
flog_err(EC_BGP_ATTRIBUTE_REPEATED,
|
||||||
|
"Prefix SID SRv6 VPN field repeated");
|
||||||
|
return bgp_attr_malformed(
|
||||||
|
args, BGP_NOTIFY_UPDATE_MAL_ATTR, args->total);
|
||||||
|
}
|
||||||
|
attr->srv6_vpn = XCALLOC(MTYPE_BGP_SRV6_VPN,
|
||||||
sizeof(struct bgp_attr_srv6_vpn));
|
sizeof(struct bgp_attr_srv6_vpn));
|
||||||
attr->srv6_vpn->refcnt = 0;
|
|
||||||
attr->srv6_vpn->sid_flags = sid_flags;
|
attr->srv6_vpn->sid_flags = sid_flags;
|
||||||
sid_copy(&attr->srv6_vpn->sid, &ipv6_sid);
|
sid_copy(&attr->srv6_vpn->sid, &ipv6_sid);
|
||||||
}
|
}
|
||||||
@ -2543,7 +2548,13 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(uint8_t type, uint16_t length,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Configure from Info */
|
/* Configure from Info */
|
||||||
attr->srv6_l3vpn = XMALLOC(MTYPE_BGP_SRV6_L3VPN,
|
if (attr->srv6_l3vpn) {
|
||||||
|
flog_err(EC_BGP_ATTRIBUTE_REPEATED,
|
||||||
|
"Prefix SID SRv6 L3VPN field repeated");
|
||||||
|
return bgp_attr_malformed(
|
||||||
|
args, BGP_NOTIFY_UPDATE_MAL_ATTR, args->total);
|
||||||
|
}
|
||||||
|
attr->srv6_l3vpn = XCALLOC(MTYPE_BGP_SRV6_L3VPN,
|
||||||
sizeof(struct bgp_attr_srv6_l3vpn));
|
sizeof(struct bgp_attr_srv6_l3vpn));
|
||||||
attr->srv6_l3vpn->sid_flags = sid_flags;
|
attr->srv6_l3vpn->sid_flags = sid_flags;
|
||||||
attr->srv6_l3vpn->endpoint_behavior = endpoint_behavior;
|
attr->srv6_l3vpn->endpoint_behavior = endpoint_behavior;
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#define MAX_ET 0xffffffff
|
#define MAX_ET 0xffffffff
|
||||||
|
|
||||||
unsigned long eth_tag_id;
|
|
||||||
struct attr;
|
struct attr;
|
||||||
|
|
||||||
/* EVPN ESI */
|
/* EVPN ESI */
|
||||||
|
@ -44,7 +44,7 @@ static int64_t bgp_clist_new_seq_get(struct community_list *list)
|
|||||||
int64_t newseq;
|
int64_t newseq;
|
||||||
struct community_entry *entry;
|
struct community_entry *entry;
|
||||||
|
|
||||||
maxseq = newseq = 0;
|
maxseq = 0;
|
||||||
|
|
||||||
for (entry = list->head; entry; entry = entry->next) {
|
for (entry = list->head; entry; entry = entry->next) {
|
||||||
if (maxseq < entry->seq)
|
if (maxseq < entry->seq)
|
||||||
@ -654,7 +654,7 @@ community_regexp_delete (struct community *com, regex_t * reg)
|
|||||||
i = 0;
|
i = 0;
|
||||||
while (i < com->size)
|
while (i < com->size)
|
||||||
{
|
{
|
||||||
memcpy (&comval, com_nthval (com, i), sizeof (uint32_t));
|
memcpy (&comval, com_nthval (com, i), sizeof(uint32_t));
|
||||||
comval = ntohl (comval);
|
comval = ntohl (comval);
|
||||||
|
|
||||||
switch (comval) {
|
switch (comval) {
|
||||||
|
@ -907,7 +907,7 @@ static void *bgp_aggr_communty_hash_alloc(void *p)
|
|||||||
return community;
|
return community;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_aggr_community_prepare(struct hash_backet *hb, void *arg)
|
static void bgp_aggr_community_prepare(struct hash_bucket *hb, void *arg)
|
||||||
{
|
{
|
||||||
struct community *hb_community = hb->data;
|
struct community *hb_community = hb->data;
|
||||||
struct community **aggr_community = arg;
|
struct community **aggr_community = arg;
|
||||||
|
@ -501,7 +501,7 @@ static const char *bgp_get_reuse_time(unsigned int penalty, char *buf,
|
|||||||
bool use_json, json_object *json)
|
bool use_json, json_object *json)
|
||||||
{
|
{
|
||||||
time_t reuse_time = 0;
|
time_t reuse_time = 0;
|
||||||
struct tm *tm = NULL;
|
struct tm tm;
|
||||||
int time_store = 0;
|
int time_store = 0;
|
||||||
|
|
||||||
if (penalty > damp[afi][safi].reuse_limit) {
|
if (penalty > damp[afi][safi].reuse_limit) {
|
||||||
@ -513,7 +513,7 @@ static const char *bgp_get_reuse_time(unsigned int penalty, char *buf,
|
|||||||
if (reuse_time > damp[afi][safi].max_suppress_time)
|
if (reuse_time > damp[afi][safi].max_suppress_time)
|
||||||
reuse_time = damp[afi][safi].max_suppress_time;
|
reuse_time = damp[afi][safi].max_suppress_time;
|
||||||
|
|
||||||
tm = gmtime(&reuse_time);
|
gmtime_r(&reuse_time, &tm);
|
||||||
} else
|
} else
|
||||||
reuse_time = 0;
|
reuse_time = 0;
|
||||||
|
|
||||||
@ -525,39 +525,39 @@ static const char *bgp_get_reuse_time(unsigned int penalty, char *buf,
|
|||||||
snprintf(buf, len, "00:00:00");
|
snprintf(buf, len, "00:00:00");
|
||||||
} else if (reuse_time < ONE_DAY_SECOND) {
|
} else if (reuse_time < ONE_DAY_SECOND) {
|
||||||
if (use_json) {
|
if (use_json) {
|
||||||
time_store = (3600000 * tm->tm_hour)
|
time_store = (3600000 * tm.tm_hour)
|
||||||
+ (60000 * tm->tm_min)
|
+ (60000 * tm.tm_min)
|
||||||
+ (1000 * tm->tm_sec);
|
+ (1000 * tm.tm_sec);
|
||||||
json_object_int_add(json, "reuseTimerMsecs",
|
json_object_int_add(json, "reuseTimerMsecs",
|
||||||
time_store);
|
time_store);
|
||||||
} else
|
} else
|
||||||
snprintf(buf, len, "%02d:%02d:%02d", tm->tm_hour,
|
snprintf(buf, len, "%02d:%02d:%02d", tm.tm_hour,
|
||||||
tm->tm_min, tm->tm_sec);
|
tm.tm_min, tm.tm_sec);
|
||||||
} else if (reuse_time < ONE_WEEK_SECOND) {
|
} else if (reuse_time < ONE_WEEK_SECOND) {
|
||||||
if (use_json) {
|
if (use_json) {
|
||||||
time_store = (86400000 * tm->tm_yday)
|
time_store = (86400000 * tm.tm_yday)
|
||||||
+ (3600000 * tm->tm_hour)
|
+ (3600000 * tm.tm_hour)
|
||||||
+ (60000 * tm->tm_min)
|
+ (60000 * tm.tm_min)
|
||||||
+ (1000 * tm->tm_sec);
|
+ (1000 * tm.tm_sec);
|
||||||
json_object_int_add(json, "reuseTimerMsecs",
|
json_object_int_add(json, "reuseTimerMsecs",
|
||||||
time_store);
|
time_store);
|
||||||
} else
|
} else
|
||||||
snprintf(buf, len, "%dd%02dh%02dm", tm->tm_yday,
|
snprintf(buf, len, "%dd%02dh%02dm", tm.tm_yday,
|
||||||
tm->tm_hour, tm->tm_min);
|
tm.tm_hour, tm.tm_min);
|
||||||
} else {
|
} else {
|
||||||
if (use_json) {
|
if (use_json) {
|
||||||
time_store =
|
time_store =
|
||||||
(604800000 * tm->tm_yday / 7)
|
(604800000 * tm.tm_yday / 7)
|
||||||
+ (86400000
|
+ (86400000
|
||||||
* (tm->tm_yday - ((tm->tm_yday / 7) * 7)))
|
* (tm.tm_yday - ((tm.tm_yday / 7) * 7)))
|
||||||
+ (3600000 * tm->tm_hour) + (60000 * tm->tm_min)
|
+ (3600000 * tm.tm_hour) + (60000 * tm.tm_min)
|
||||||
+ (1000 * tm->tm_sec);
|
+ (1000 * tm.tm_sec);
|
||||||
json_object_int_add(json, "reuseTimerMsecs",
|
json_object_int_add(json, "reuseTimerMsecs",
|
||||||
time_store);
|
time_store);
|
||||||
} else
|
} else
|
||||||
snprintf(buf, len, "%02dw%dd%02dh", tm->tm_yday / 7,
|
snprintf(buf, len, "%02dw%dd%02dh", tm.tm_yday / 7,
|
||||||
tm->tm_yday - ((tm->tm_yday / 7) * 7),
|
tm.tm_yday - ((tm.tm_yday / 7) * 7),
|
||||||
tm->tm_hour);
|
tm.tm_hour);
|
||||||
}
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
@ -106,19 +106,19 @@ static FILE *bgp_dump_open_file(struct bgp_dump *bgp_dump)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
time_t clock;
|
time_t clock;
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
char fullpath[MAXPATHLEN];
|
char fullpath[MAXPATHLEN];
|
||||||
char realpath[MAXPATHLEN];
|
char realpath[MAXPATHLEN];
|
||||||
mode_t oldumask;
|
mode_t oldumask;
|
||||||
|
|
||||||
time(&clock);
|
time(&clock);
|
||||||
tm = localtime(&clock);
|
localtime_r(&clock, &tm);
|
||||||
|
|
||||||
if (bgp_dump->filename[0] != DIRECTORY_SEP) {
|
if (bgp_dump->filename[0] != DIRECTORY_SEP) {
|
||||||
sprintf(fullpath, "%s/%s", vty_get_cwd(), bgp_dump->filename);
|
sprintf(fullpath, "%s/%s", vty_get_cwd(), bgp_dump->filename);
|
||||||
ret = strftime(realpath, MAXPATHLEN, fullpath, tm);
|
ret = strftime(realpath, MAXPATHLEN, fullpath, &tm);
|
||||||
} else
|
} else
|
||||||
ret = strftime(realpath, MAXPATHLEN, bgp_dump->filename, tm);
|
ret = strftime(realpath, MAXPATHLEN, bgp_dump->filename, &tm);
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
flog_warn(EC_BGP_DUMP, "bgp_dump_open_file: strftime error");
|
flog_warn(EC_BGP_DUMP, "bgp_dump_open_file: strftime error");
|
||||||
@ -147,7 +147,7 @@ static int bgp_dump_interval_add(struct bgp_dump *bgp_dump, int interval)
|
|||||||
{
|
{
|
||||||
int secs_into_day;
|
int secs_into_day;
|
||||||
time_t t;
|
time_t t;
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
|
|
||||||
if (interval > 0) {
|
if (interval > 0) {
|
||||||
/* Periodic dump every interval seconds */
|
/* Periodic dump every interval seconds */
|
||||||
@ -158,9 +158,9 @@ static int bgp_dump_interval_add(struct bgp_dump *bgp_dump, int interval)
|
|||||||
* midnight
|
* midnight
|
||||||
*/
|
*/
|
||||||
(void)time(&t);
|
(void)time(&t);
|
||||||
tm = localtime(&t);
|
localtime_r(&t, &tm);
|
||||||
secs_into_day = tm->tm_sec + 60 * tm->tm_min
|
secs_into_day = tm.tm_sec + 60 * tm.tm_min
|
||||||
+ 60 * 60 * tm->tm_hour;
|
+ 60 * 60 * tm.tm_hour;
|
||||||
interval = interval
|
interval = interval
|
||||||
- secs_into_day % interval; /* always > 0 */
|
- secs_into_day % interval; /* always > 0 */
|
||||||
}
|
}
|
||||||
|
@ -1026,7 +1026,7 @@ static void *bgp_aggr_ecommunty_hash_alloc(void *p)
|
|||||||
return ecommunity;
|
return ecommunity;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_aggr_ecommunity_prepare(struct hash_backet *hb, void *arg)
|
static void bgp_aggr_ecommunity_prepare(struct hash_bucket *hb, void *arg)
|
||||||
{
|
{
|
||||||
struct ecommunity *hb_ecommunity = hb->data;
|
struct ecommunity *hb_ecommunity = hb->data;
|
||||||
struct ecommunity **aggr_ecommunity = arg;
|
struct ecommunity **aggr_ecommunity = arg;
|
||||||
|
@ -600,8 +600,9 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,
|
|||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zebra instance to talk to, not installing remote macip",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: No zebra instance to talk to, not installing remote macip",
|
||||||
|
__func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
s = zclient->obuf;
|
s = zclient->obuf;
|
||||||
@ -662,8 +663,9 @@ static int bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,
|
|||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zebra instance to talk to, not installing remote vtep",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: No zebra instance to talk to, not installing remote vtep",
|
||||||
|
__func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1450,7 +1450,7 @@ static int bgp_connect_success(struct peer *peer)
|
|||||||
if (bgp_getsockname(peer) < 0) {
|
if (bgp_getsockname(peer) < 0) {
|
||||||
flog_err_sys(EC_LIB_SOCKET,
|
flog_err_sys(EC_LIB_SOCKET,
|
||||||
"%s: bgp_getsockname(): failed for peer %s, fd %d",
|
"%s: bgp_getsockname(): failed for peer %s, fd %d",
|
||||||
__FUNCTION__, peer->host, peer->fd);
|
__func__, peer->host, peer->fd);
|
||||||
bgp_notify_send(
|
bgp_notify_send(
|
||||||
peer, BGP_NOTIFY_FSM_ERR,
|
peer, BGP_NOTIFY_FSM_ERR,
|
||||||
BGP_NOTIFY_SUBCODE_UNSPECIFIC); /* internal error */
|
BGP_NOTIFY_SUBCODE_UNSPECIFIC); /* internal error */
|
||||||
|
@ -550,7 +550,7 @@ static void *bgp_aggr_lcommunty_hash_alloc(void *p)
|
|||||||
return lcommunity;
|
return lcommunity;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_aggr_lcommunity_prepare(struct hash_backet *hb, void *arg)
|
static void bgp_aggr_lcommunity_prepare(struct hash_bucket *hb, void *arg)
|
||||||
{
|
{
|
||||||
struct lcommunity *hb_lcommunity = hb->data;
|
struct lcommunity *hb_lcommunity = hb->data;
|
||||||
struct lcommunity **aggr_lcommunity = arg;
|
struct lcommunity **aggr_lcommunity = arg;
|
||||||
|
@ -153,7 +153,7 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,
|
|||||||
if (BGP_DEBUG(nht, NHT)) {
|
if (BGP_DEBUG(nht, NHT)) {
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Attempting to register with unknown AFI %d (not %d or %d)",
|
"%s: Attempting to register with unknown AFI %d (not %d or %d)",
|
||||||
__FUNCTION__, afi, AFI_IP, AFI_IP6);
|
__func__, afi, AFI_IP, AFI_IP6);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
|
|||||||
if (!zapi_nexthop_update_decode(zclient->ibuf, &nhr)) {
|
if (!zapi_nexthop_update_decode(zclient->ibuf, &nhr)) {
|
||||||
if (BGP_DEBUG(nht, NHT))
|
if (BGP_DEBUG(nht, NHT))
|
||||||
zlog_debug("%s[%s]: Failure to decode nexthop update",
|
zlog_debug("%s[%s]: Failure to decode nexthop update",
|
||||||
__PRETTY_FUNCTION__, bgp->name_pretty);
|
__func__, bgp->name_pretty);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -563,7 +563,7 @@ static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p)
|
|||||||
if (BGP_DEBUG(nht, NHT)) {
|
if (BGP_DEBUG(nht, NHT)) {
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Attempting to make prefix with unknown AFI %d (not %d or %d)",
|
"%s: Attempting to make prefix with unknown AFI %d (not %d or %d)",
|
||||||
__FUNCTION__, afi, AFI_IP, AFI_IP6);
|
__func__, afi, AFI_IP, AFI_IP6);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -591,15 +591,17 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
|
|||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bnc->bgp)) {
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bnc->bgp)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zebra instance to talk to, not installing NHT entry",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: No zebra instance to talk to, not installing NHT entry",
|
||||||
|
__func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bgp_zebra_num_connects()) {
|
if (!bgp_zebra_num_connects()) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: We have not connected yet, cannot send nexthops",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: We have not connected yet, cannot send nexthops",
|
||||||
|
__func__);
|
||||||
}
|
}
|
||||||
p = &(bnc->node->p);
|
p = &(bnc->node->p);
|
||||||
if ((command == ZEBRA_NEXTHOP_REGISTER
|
if ((command == ZEBRA_NEXTHOP_REGISTER
|
||||||
@ -801,9 +803,10 @@ static void evaluate_paths(struct bgp_nexthop_cache *bnc)
|
|||||||
|
|
||||||
if (!CHECK_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED)) {
|
if (!CHECK_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED)) {
|
||||||
if (BGP_DEBUG(nht, NHT))
|
if (BGP_DEBUG(nht, NHT))
|
||||||
zlog_debug("%s: Updating peer (%s(%s)) status with NHT",
|
zlog_debug(
|
||||||
__FUNCTION__, peer->host,
|
"%s: Updating peer (%s(%s)) status with NHT",
|
||||||
peer->bgp->name_pretty);
|
__func__, peer->host,
|
||||||
|
peer->bgp->name_pretty);
|
||||||
bgp_fsm_event_update(peer, valid_nexthops);
|
bgp_fsm_event_update(peer, valid_nexthops);
|
||||||
SET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);
|
SET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);
|
||||||
}
|
}
|
||||||
@ -882,7 +885,7 @@ void bgp_nht_register_enhe_capability_interfaces(struct peer *peer)
|
|||||||
if (!sockunion2hostprefix(&peer->su, &p)) {
|
if (!sockunion2hostprefix(&peer->su, &p)) {
|
||||||
if (BGP_DEBUG(nht, NHT))
|
if (BGP_DEBUG(nht, NHT))
|
||||||
zlog_debug("%s: Unable to convert prefix to sockunion",
|
zlog_debug("%s: Unable to convert prefix to sockunion",
|
||||||
__PRETTY_FUNCTION__);
|
__func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ static int bgp_capability_hostname(struct peer *peer,
|
|||||||
flog_warn(
|
flog_warn(
|
||||||
EC_BGP_CAPABILITY_INVALID_DATA,
|
EC_BGP_CAPABILITY_INVALID_DATA,
|
||||||
"%s: Received malformed hostname capability from peer %s",
|
"%s: Received malformed hostname capability from peer %s",
|
||||||
__FUNCTION__, peer->host);
|
__func__, peer->host);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ static int bgp_capability_hostname(struct peer *peer,
|
|||||||
flog_warn(
|
flog_warn(
|
||||||
EC_BGP_CAPABILITY_INVALID_DATA,
|
EC_BGP_CAPABILITY_INVALID_DATA,
|
||||||
"%s: Received invalid domain name len (hostname capability) from peer %s",
|
"%s: Received invalid domain name len (hostname capability) from peer %s",
|
||||||
__FUNCTION__, peer->host);
|
__func__, peer->host);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -729,7 +729,7 @@ static int bgp_capability_hostname(struct peer *peer,
|
|||||||
flog_warn(
|
flog_warn(
|
||||||
EC_BGP_CAPABILITY_INVALID_DATA,
|
EC_BGP_CAPABILITY_INVALID_DATA,
|
||||||
"%s: Received runt domain name (hostname capability) from peer %s",
|
"%s: Received runt domain name (hostname capability) from peer %s",
|
||||||
__FUNCTION__, peer->host);
|
__func__, peer->host);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1303,8 +1303,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
|
|||||||
|
|
||||||
/* Open option part parse. */
|
/* Open option part parse. */
|
||||||
if (optlen != 0) {
|
if (optlen != 0) {
|
||||||
if ((ret = bgp_open_option_parse(peer, optlen, &mp_capability))
|
if (bgp_open_option_parse(peer, optlen, &mp_capability) < 0)
|
||||||
< 0)
|
|
||||||
return BGP_Stop;
|
return BGP_Stop;
|
||||||
} else {
|
} else {
|
||||||
if (bgp_debug_neighbor_events(peer))
|
if (bgp_debug_neighbor_events(peer))
|
||||||
@ -1346,10 +1345,10 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
|
|||||||
return BGP_Stop;
|
return BGP_Stop;
|
||||||
|
|
||||||
/* Get sockname. */
|
/* Get sockname. */
|
||||||
if ((ret = bgp_getsockname(peer)) < 0) {
|
if (bgp_getsockname(peer) < 0) {
|
||||||
flog_err_sys(EC_LIB_SOCKET,
|
flog_err_sys(EC_LIB_SOCKET,
|
||||||
"%s: bgp_getsockname() failed for peer: %s",
|
"%s: bgp_getsockname() failed for peer: %s",
|
||||||
__FUNCTION__, peer->host);
|
__func__, peer->host);
|
||||||
return BGP_Stop;
|
return BGP_Stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1972,38 +1971,29 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size)
|
|||||||
} else
|
} else
|
||||||
p_pnt = p_end;
|
p_pnt = p_end;
|
||||||
|
|
||||||
if ((ok = (p_pnt < p_end)))
|
/* val checked in prefix_bgp_orf_set */
|
||||||
orfp.ge =
|
if (p_pnt < p_end)
|
||||||
*p_pnt++; /* value
|
orfp.ge = *p_pnt++;
|
||||||
checked in
|
|
||||||
prefix_bgp_orf_set()
|
/* val checked in prefix_bgp_orf_set */
|
||||||
*/
|
if (p_pnt < p_end)
|
||||||
if ((ok = (p_pnt < p_end)))
|
orfp.le = *p_pnt++;
|
||||||
orfp.le =
|
|
||||||
*p_pnt++; /* value
|
|
||||||
checked in
|
|
||||||
prefix_bgp_orf_set()
|
|
||||||
*/
|
|
||||||
if ((ok = (p_pnt < p_end)))
|
if ((ok = (p_pnt < p_end)))
|
||||||
orfp.p.prefixlen = *p_pnt++;
|
orfp.p.prefixlen = *p_pnt++;
|
||||||
orfp.p.family = afi2family(
|
|
||||||
afi); /* afi checked already */
|
|
||||||
|
|
||||||
psize = PSIZE(
|
/* afi checked already */
|
||||||
orfp.p.prefixlen); /* 0 if not
|
orfp.p.family = afi2family(afi);
|
||||||
ok */
|
|
||||||
if (psize
|
/* 0 if not ok */
|
||||||
> prefix_blen(
|
psize = PSIZE(orfp.p.prefixlen);
|
||||||
&orfp.p)) /* valid for
|
/* valid for family ? */
|
||||||
family ? */
|
if (psize > prefix_blen(&orfp.p)) {
|
||||||
{
|
|
||||||
ok = 0;
|
ok = 0;
|
||||||
psize = prefix_blen(&orfp.p);
|
psize = prefix_blen(&orfp.p);
|
||||||
}
|
}
|
||||||
if (psize
|
/* valid for packet ? */
|
||||||
> (p_end - p_pnt)) /* valid for
|
if (psize > (p_end - p_pnt)) {
|
||||||
packet ? */
|
|
||||||
{
|
|
||||||
ok = 0;
|
ok = 0;
|
||||||
psize = p_end - p_pnt;
|
psize = p_end - p_pnt;
|
||||||
}
|
}
|
||||||
|
@ -122,8 +122,6 @@ struct bgp_node *bgp_afi_node_get(struct bgp_table *table, afi_t afi,
|
|||||||
struct bgp_node *prn = NULL;
|
struct bgp_node *prn = NULL;
|
||||||
|
|
||||||
assert(table);
|
assert(table);
|
||||||
if (!table)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP)
|
if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP)
|
||||||
|| (safi == SAFI_EVPN)) {
|
|| (safi == SAFI_EVPN)) {
|
||||||
@ -299,7 +297,7 @@ static int bgp_node_set_defer_flag(struct bgp_node *rn, bool delete)
|
|||||||
{
|
{
|
||||||
struct peer *peer;
|
struct peer *peer;
|
||||||
struct bgp_path_info *old_pi, *nextpi;
|
struct bgp_path_info *old_pi, *nextpi;
|
||||||
bool set_flag = 0;
|
bool set_flag = false;
|
||||||
struct bgp *bgp = NULL;
|
struct bgp *bgp = NULL;
|
||||||
struct bgp_table *table = NULL;
|
struct bgp_table *table = NULL;
|
||||||
afi_t afi = 0;
|
afi_t afi = 0;
|
||||||
@ -339,7 +337,7 @@ static int bgp_node_set_defer_flag(struct bgp_node *rn, bool delete)
|
|||||||
*/
|
*/
|
||||||
if (CHECK_FLAG(old_pi->flags, BGP_PATH_STALE)
|
if (CHECK_FLAG(old_pi->flags, BGP_PATH_STALE)
|
||||||
&& (old_pi->sub_type == BGP_ROUTE_NORMAL)) {
|
&& (old_pi->sub_type == BGP_ROUTE_NORMAL)) {
|
||||||
set_flag = 1;
|
set_flag = true;
|
||||||
} else {
|
} else {
|
||||||
/* If the peer is graceful restart capable and peer is
|
/* If the peer is graceful restart capable and peer is
|
||||||
* restarting mode, set the flag BGP_NODE_SELECT_DEFER
|
* restarting mode, set the flag BGP_NODE_SELECT_DEFER
|
||||||
@ -349,7 +347,7 @@ static int bgp_node_set_defer_flag(struct bgp_node *rn, bool delete)
|
|||||||
&& BGP_PEER_RESTARTING_MODE(peer)
|
&& BGP_PEER_RESTARTING_MODE(peer)
|
||||||
&& (old_pi
|
&& (old_pi
|
||||||
&& old_pi->sub_type == BGP_ROUTE_NORMAL)) {
|
&& old_pi->sub_type == BGP_ROUTE_NORMAL)) {
|
||||||
set_flag = 1;
|
set_flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (set_flag)
|
if (set_flag)
|
||||||
@ -2926,8 +2924,7 @@ static int bgp_maximum_prefix_restart_timer(struct thread *thread)
|
|||||||
peer->host);
|
peer->host);
|
||||||
|
|
||||||
if ((peer_clear(peer, NULL) < 0) && bgp_debug_neighbor_events(peer))
|
if ((peer_clear(peer, NULL) < 0) && bgp_debug_neighbor_events(peer))
|
||||||
zlog_debug("%s: %s peer_clear failed",
|
zlog_debug("%s: %s peer_clear failed", __func__, peer->host);
|
||||||
__PRETTY_FUNCTION__, peer->host);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3732,7 +3729,7 @@ int bgp_update(struct peer *peer, struct prefix *p, uint32_t addpath_id,
|
|||||||
->nexthop,
|
->nexthop,
|
||||||
buf1, INET6_ADDRSTRLEN);
|
buf1, INET6_ADDRSTRLEN);
|
||||||
zlog_debug("%s(%s): NH unresolved",
|
zlog_debug("%s(%s): NH unresolved",
|
||||||
__FUNCTION__, buf1);
|
__func__, buf1);
|
||||||
}
|
}
|
||||||
bgp_path_info_unset_flag(rn, pi,
|
bgp_path_info_unset_flag(rn, pi,
|
||||||
BGP_PATH_VALID);
|
BGP_PATH_VALID);
|
||||||
@ -3880,8 +3877,8 @@ int bgp_update(struct peer *peer, struct prefix *p, uint32_t addpath_id,
|
|||||||
inet_ntop(AF_INET,
|
inet_ntop(AF_INET,
|
||||||
(const void *)&attr_new->nexthop,
|
(const void *)&attr_new->nexthop,
|
||||||
buf1, INET6_ADDRSTRLEN);
|
buf1, INET6_ADDRSTRLEN);
|
||||||
zlog_debug("%s(%s): NH unresolved",
|
zlog_debug("%s(%s): NH unresolved", __func__,
|
||||||
__FUNCTION__, buf1);
|
buf1);
|
||||||
}
|
}
|
||||||
bgp_path_info_unset_flag(rn, new, BGP_PATH_VALID);
|
bgp_path_info_unset_flag(rn, new, BGP_PATH_VALID);
|
||||||
}
|
}
|
||||||
@ -4909,8 +4906,6 @@ void bgp_static_update(struct bgp *bgp, struct prefix *p,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert(bgp_static);
|
assert(bgp_static);
|
||||||
if (!bgp_static)
|
|
||||||
return;
|
|
||||||
|
|
||||||
rn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, NULL);
|
rn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, NULL);
|
||||||
|
|
||||||
@ -5040,7 +5035,7 @@ void bgp_static_update(struct bgp *bgp, struct prefix *p,
|
|||||||
INET6_ADDRSTRLEN);
|
INET6_ADDRSTRLEN);
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%s): Route not in table, not advertising",
|
"%s(%s): Route not in table, not advertising",
|
||||||
__FUNCTION__, buf1);
|
__func__, buf1);
|
||||||
}
|
}
|
||||||
bgp_path_info_unset_flag(
|
bgp_path_info_unset_flag(
|
||||||
rn, pi, BGP_PATH_VALID);
|
rn, pi, BGP_PATH_VALID);
|
||||||
@ -5089,7 +5084,7 @@ void bgp_static_update(struct bgp *bgp, struct prefix *p,
|
|||||||
INET6_ADDRSTRLEN);
|
INET6_ADDRSTRLEN);
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%s): Route not in table, not advertising",
|
"%s(%s): Route not in table, not advertising",
|
||||||
__FUNCTION__, buf1);
|
__func__, buf1);
|
||||||
}
|
}
|
||||||
bgp_path_info_unset_flag(rn, new, BGP_PATH_VALID);
|
bgp_path_info_unset_flag(rn, new, BGP_PATH_VALID);
|
||||||
}
|
}
|
||||||
|
@ -4400,10 +4400,10 @@ DEFUN (no_set_distance,
|
|||||||
|
|
||||||
DEFUN (set_local_pref,
|
DEFUN (set_local_pref,
|
||||||
set_local_pref_cmd,
|
set_local_pref_cmd,
|
||||||
"set local-preference (0-4294967295)",
|
"set local-preference WORD",
|
||||||
SET_STR
|
SET_STR
|
||||||
"BGP local preference path attribute\n"
|
"BGP local preference path attribute\n"
|
||||||
"Preference value\n")
|
"Preference value (0-4294967295)\n")
|
||||||
{
|
{
|
||||||
int idx_number = 2;
|
int idx_number = 2;
|
||||||
return generic_set_add(vty, VTY_GET_CONTEXT(route_map_index),
|
return generic_set_add(vty, VTY_GET_CONTEXT(route_map_index),
|
||||||
@ -4413,11 +4413,11 @@ DEFUN (set_local_pref,
|
|||||||
|
|
||||||
DEFUN (no_set_local_pref,
|
DEFUN (no_set_local_pref,
|
||||||
no_set_local_pref_cmd,
|
no_set_local_pref_cmd,
|
||||||
"no set local-preference [(0-4294967295)]",
|
"no set local-preference [WORD]",
|
||||||
NO_STR
|
NO_STR
|
||||||
SET_STR
|
SET_STR
|
||||||
"BGP local preference path attribute\n"
|
"BGP local preference path attribute\n"
|
||||||
"Preference value\n")
|
"Preference value (0-4294967295)\n")
|
||||||
{
|
{
|
||||||
int idx_localpref = 3;
|
int idx_localpref = 3;
|
||||||
if (argc <= idx_localpref)
|
if (argc <= idx_localpref)
|
||||||
|
@ -869,7 +869,7 @@ static int bgpTrapEstablished(struct peer *peer)
|
|||||||
|
|
||||||
smux_trap(bgp_variables, array_size(bgp_variables), bgp_trap_oid,
|
smux_trap(bgp_variables, array_size(bgp_variables), bgp_trap_oid,
|
||||||
array_size(bgp_trap_oid), bgp_oid,
|
array_size(bgp_trap_oid), bgp_oid,
|
||||||
sizeof bgp_oid / sizeof(oid), index, IN_ADDR_SIZE,
|
sizeof(bgp_oid) / sizeof(oid), index, IN_ADDR_SIZE,
|
||||||
bgpTrapList, array_size(bgpTrapList), BGPESTABLISHED);
|
bgpTrapList, array_size(bgpTrapList), BGPESTABLISHED);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -888,7 +888,7 @@ static int bgpTrapBackwardTransition(struct peer *peer)
|
|||||||
|
|
||||||
smux_trap(bgp_variables, array_size(bgp_variables), bgp_trap_oid,
|
smux_trap(bgp_variables, array_size(bgp_variables), bgp_trap_oid,
|
||||||
array_size(bgp_trap_oid), bgp_oid,
|
array_size(bgp_trap_oid), bgp_oid,
|
||||||
sizeof bgp_oid / sizeof(oid), index, IN_ADDR_SIZE,
|
sizeof(bgp_oid) / sizeof(oid), index, IN_ADDR_SIZE,
|
||||||
bgpTrapList, array_size(bgpTrapList), BGPBACKWARDTRANSITION);
|
bgpTrapList, array_size(bgpTrapList), BGPBACKWARDTRANSITION);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -330,8 +330,6 @@ void bpacket_queue_remove_peer(struct peer_af *paf)
|
|||||||
|
|
||||||
q = PAF_PKTQ(paf);
|
q = PAF_PKTQ(paf);
|
||||||
assert(q);
|
assert(q);
|
||||||
if (!q)
|
|
||||||
return;
|
|
||||||
|
|
||||||
LIST_REMOVE(paf, pkt_train);
|
LIST_REMOVE(paf, pkt_train);
|
||||||
paf->next_pkt_to_send = NULL;
|
paf->next_pkt_to_send = NULL;
|
||||||
|
@ -753,7 +753,7 @@ static void bgp_clear_vty_error(struct vty *vty, struct peer *peer, afi_t afi,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int bgp_peer_clear(struct peer *peer, afi_t afi, safi_t safi,
|
static int bgp_peer_clear(struct peer *peer, afi_t afi, safi_t safi,
|
||||||
struct listnode *nnode, enum bgp_clear_type stype)
|
struct listnode **nnode, enum bgp_clear_type stype)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
@ -767,7 +767,7 @@ static int bgp_peer_clear(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (stype == BGP_CLEAR_SOFT_NONE)
|
if (stype == BGP_CLEAR_SOFT_NONE)
|
||||||
ret = peer_clear(peer, &nnode);
|
ret = peer_clear(peer, nnode);
|
||||||
else
|
else
|
||||||
ret = peer_clear_soft(peer, tmp_afi, tmp_safi,
|
ret = peer_clear_soft(peer, tmp_afi, tmp_safi,
|
||||||
stype);
|
stype);
|
||||||
@ -782,7 +782,7 @@ static int bgp_peer_clear(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (stype == BGP_CLEAR_SOFT_NONE)
|
if (stype == BGP_CLEAR_SOFT_NONE)
|
||||||
ret = peer_clear(peer, &nnode);
|
ret = peer_clear(peer, nnode);
|
||||||
else
|
else
|
||||||
ret = peer_clear_soft(peer, afi,
|
ret = peer_clear_soft(peer, afi,
|
||||||
tmp_safi, stype);
|
tmp_safi, stype);
|
||||||
@ -793,7 +793,7 @@ static int bgp_peer_clear(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (stype == BGP_CLEAR_SOFT_NONE)
|
if (stype == BGP_CLEAR_SOFT_NONE)
|
||||||
ret = peer_clear(peer, &nnode);
|
ret = peer_clear(peer, nnode);
|
||||||
else
|
else
|
||||||
ret = peer_clear_soft(peer, afi, safi, stype);
|
ret = peer_clear_soft(peer, afi, safi, stype);
|
||||||
}
|
}
|
||||||
@ -826,7 +826,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
|
|||||||
if (CHECK_FLAG(peer->flags, PEER_FLAG_GRACEFUL_RESTART))
|
if (CHECK_FLAG(peer->flags, PEER_FLAG_GRACEFUL_RESTART))
|
||||||
gr_router_detected = true;
|
gr_router_detected = true;
|
||||||
|
|
||||||
ret = bgp_peer_clear(peer, afi, safi, nnode,
|
ret = bgp_peer_clear(peer, afi, safi, &nnode,
|
||||||
stype);
|
stype);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -901,7 +901,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS(group->peer, node, nnode, peer)) {
|
for (ALL_LIST_ELEMENTS(group->peer, node, nnode, peer)) {
|
||||||
ret = bgp_peer_clear(peer, afi, safi, nnode, stype);
|
ret = bgp_peer_clear(peer, afi, safi, &nnode, stype);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
bgp_clear_vty_error(vty, peer, afi, safi, ret);
|
bgp_clear_vty_error(vty, peer, afi, safi, ret);
|
||||||
@ -928,7 +928,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
|
|||||||
if (CHECK_FLAG(peer->flags, PEER_FLAG_GRACEFUL_RESTART))
|
if (CHECK_FLAG(peer->flags, PEER_FLAG_GRACEFUL_RESTART))
|
||||||
gr_router_detected = true;
|
gr_router_detected = true;
|
||||||
|
|
||||||
ret = bgp_peer_clear(peer, afi, safi, nnode, stype);
|
ret = bgp_peer_clear(peer, afi, safi, &nnode, stype);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
bgp_clear_vty_error(vty, peer, afi, safi, ret);
|
bgp_clear_vty_error(vty, peer, afi, safi, ret);
|
||||||
@ -965,7 +965,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
|
|||||||
if (CHECK_FLAG(peer->flags, PEER_FLAG_GRACEFUL_RESTART))
|
if (CHECK_FLAG(peer->flags, PEER_FLAG_GRACEFUL_RESTART))
|
||||||
gr_router_detected = true;
|
gr_router_detected = true;
|
||||||
|
|
||||||
ret = bgp_peer_clear(peer, afi, safi, nnode, stype);
|
ret = bgp_peer_clear(peer, afi, safi, &nnode, stype);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
bgp_clear_vty_error(vty, peer, afi, safi, ret);
|
bgp_clear_vty_error(vty, peer, afi, safi, ret);
|
||||||
@ -7304,7 +7304,7 @@ ALIAS (af_label_vpn_export,
|
|||||||
|
|
||||||
DEFPY (af_nexthop_vpn_export,
|
DEFPY (af_nexthop_vpn_export,
|
||||||
af_nexthop_vpn_export_cmd,
|
af_nexthop_vpn_export_cmd,
|
||||||
"[no] nexthop vpn export <A.B.C.D|X:X::X:X>$nexthop_str",
|
"[no] nexthop vpn export [<A.B.C.D|X:X::X:X>$nexthop_su]",
|
||||||
NO_STR
|
NO_STR
|
||||||
"Specify next hop to use for VRF advertised prefixes\n"
|
"Specify next hop to use for VRF advertised prefixes\n"
|
||||||
"Between current address-family and vpn\n"
|
"Between current address-family and vpn\n"
|
||||||
@ -7315,14 +7315,14 @@ DEFPY (af_nexthop_vpn_export,
|
|||||||
VTY_DECLVAR_CONTEXT(bgp, bgp);
|
VTY_DECLVAR_CONTEXT(bgp, bgp);
|
||||||
afi_t afi;
|
afi_t afi;
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
int idx = 0;
|
|
||||||
int yes = 1;
|
|
||||||
|
|
||||||
if (argv_find(argv, argc, "no", &idx))
|
if (!no) {
|
||||||
yes = 0;
|
if (!nexthop_su) {
|
||||||
|
vty_out(vty, "%% Nexthop required\n");
|
||||||
|
return CMD_WARNING_CONFIG_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
if (yes) {
|
if (!sockunion2hostprefix(nexthop_su, &p))
|
||||||
if (!sockunion2hostprefix(nexthop_str, &p))
|
|
||||||
return CMD_WARNING_CONFIG_FAILED;
|
return CMD_WARNING_CONFIG_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7336,7 +7336,7 @@ DEFPY (af_nexthop_vpn_export,
|
|||||||
vpn_leak_prechange(BGP_VPN_POLICY_DIR_TOVPN, afi,
|
vpn_leak_prechange(BGP_VPN_POLICY_DIR_TOVPN, afi,
|
||||||
bgp_get_default(), bgp);
|
bgp_get_default(), bgp);
|
||||||
|
|
||||||
if (yes) {
|
if (!no) {
|
||||||
bgp->vpn_policy[afi].tovpn_nexthop = p;
|
bgp->vpn_policy[afi].tovpn_nexthop = p;
|
||||||
SET_FLAG(bgp->vpn_policy[afi].flags,
|
SET_FLAG(bgp->vpn_policy[afi].flags,
|
||||||
BGP_VPN_POLICY_TOVPN_NEXTHOP_SET);
|
BGP_VPN_POLICY_TOVPN_NEXTHOP_SET);
|
||||||
@ -7352,14 +7352,6 @@ DEFPY (af_nexthop_vpn_export,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ALIAS (af_nexthop_vpn_export,
|
|
||||||
af_no_nexthop_vpn_export_cmd,
|
|
||||||
"no nexthop vpn export",
|
|
||||||
NO_STR
|
|
||||||
"Specify next hop to use for VRF advertised prefixes\n"
|
|
||||||
"Between current address-family and vpn\n"
|
|
||||||
"For routes leaked from current address-family to vpn\n")
|
|
||||||
|
|
||||||
static int vpn_policy_getdirs(struct vty *vty, const char *dstr, int *dodir)
|
static int vpn_policy_getdirs(struct vty *vty, const char *dstr, int *dodir)
|
||||||
{
|
{
|
||||||
if (!strcmp(dstr, "import")) {
|
if (!strcmp(dstr, "import")) {
|
||||||
@ -9440,7 +9432,7 @@ static void bgp_show_neighnor_graceful_restart_rbit(struct vty *vty,
|
|||||||
bool use_json,
|
bool use_json,
|
||||||
json_object *json)
|
json_object *json)
|
||||||
{
|
{
|
||||||
bool rbit_status = 0;
|
bool rbit_status = false;
|
||||||
|
|
||||||
if (!use_json)
|
if (!use_json)
|
||||||
vty_out(vty, "\n R bit: ");
|
vty_out(vty, "\n R bit: ");
|
||||||
@ -9450,9 +9442,9 @@ static void bgp_show_neighnor_graceful_restart_rbit(struct vty *vty,
|
|||||||
&& (p->status == Established)) {
|
&& (p->status == Established)) {
|
||||||
|
|
||||||
if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_BIT_RCV))
|
if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_BIT_RCV))
|
||||||
rbit_status = 1;
|
rbit_status = true;
|
||||||
else
|
else
|
||||||
rbit_status = 0;
|
rbit_status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rbit_status) {
|
if (rbit_status) {
|
||||||
@ -10657,28 +10649,31 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
|
|||||||
|
|
||||||
/* read timer */
|
/* read timer */
|
||||||
time_t uptime;
|
time_t uptime;
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
|
|
||||||
uptime = bgp_clock();
|
uptime = bgp_clock();
|
||||||
uptime -= p->readtime;
|
uptime -= p->readtime;
|
||||||
tm = gmtime(&uptime);
|
gmtime_r(&uptime, &tm);
|
||||||
|
|
||||||
json_object_int_add(json_neigh, "bgpTimerLastRead",
|
json_object_int_add(json_neigh, "bgpTimerLastRead",
|
||||||
(tm->tm_sec * 1000) + (tm->tm_min * 60000)
|
(tm.tm_sec * 1000) + (tm.tm_min * 60000)
|
||||||
+ (tm->tm_hour * 3600000));
|
+ (tm.tm_hour * 3600000));
|
||||||
|
|
||||||
uptime = bgp_clock();
|
uptime = bgp_clock();
|
||||||
uptime -= p->last_write;
|
uptime -= p->last_write;
|
||||||
tm = gmtime(&uptime);
|
gmtime_r(&uptime, &tm);
|
||||||
|
|
||||||
json_object_int_add(json_neigh, "bgpTimerLastWrite",
|
json_object_int_add(json_neigh, "bgpTimerLastWrite",
|
||||||
(tm->tm_sec * 1000) + (tm->tm_min * 60000)
|
(tm.tm_sec * 1000) + (tm.tm_min * 60000)
|
||||||
+ (tm->tm_hour * 3600000));
|
+ (tm.tm_hour * 3600000));
|
||||||
|
|
||||||
uptime = bgp_clock();
|
uptime = bgp_clock();
|
||||||
uptime -= p->update_time;
|
uptime -= p->update_time;
|
||||||
tm = gmtime(&uptime);
|
gmtime_r(&uptime, &tm);
|
||||||
|
|
||||||
json_object_int_add(json_neigh, "bgpInUpdateElapsedTimeMsecs",
|
json_object_int_add(json_neigh, "bgpInUpdateElapsedTimeMsecs",
|
||||||
(tm->tm_sec * 1000) + (tm->tm_min * 60000)
|
(tm.tm_sec * 1000) + (tm.tm_min * 60000)
|
||||||
+ (tm->tm_hour * 3600000));
|
+ (tm.tm_hour * 3600000));
|
||||||
|
|
||||||
/* Configured timer values. */
|
/* Configured timer values. */
|
||||||
json_object_int_add(json_neigh, "bgpTimerHoldTimeMsecs",
|
json_object_int_add(json_neigh, "bgpTimerHoldTimeMsecs",
|
||||||
@ -11506,12 +11501,12 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
|
|||||||
|
|
||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
|
|
||||||
/* Gracefull Restart */
|
/* Graceful Restart */
|
||||||
if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV)
|
if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV)
|
||||||
|| CHECK_FLAG(p->cap,
|
|| CHECK_FLAG(p->cap,
|
||||||
PEER_CAP_RESTART_ADV)) {
|
PEER_CAP_RESTART_ADV)) {
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
" Graceful Restart Capabilty:");
|
" Graceful Restart Capability:");
|
||||||
if (CHECK_FLAG(p->cap,
|
if (CHECK_FLAG(p->cap,
|
||||||
PEER_CAP_RESTART_ADV))
|
PEER_CAP_RESTART_ADV))
|
||||||
vty_out(vty, " advertised");
|
vty_out(vty, " advertised");
|
||||||
@ -11841,15 +11836,16 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
|
|||||||
} else {
|
} else {
|
||||||
if (use_json) {
|
if (use_json) {
|
||||||
time_t uptime;
|
time_t uptime;
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
|
|
||||||
uptime = bgp_clock();
|
uptime = bgp_clock();
|
||||||
uptime -= p->resettime;
|
uptime -= p->resettime;
|
||||||
tm = gmtime(&uptime);
|
gmtime_r(&uptime, &tm);
|
||||||
|
|
||||||
json_object_int_add(json_neigh, "lastResetTimerMsecs",
|
json_object_int_add(json_neigh, "lastResetTimerMsecs",
|
||||||
(tm->tm_sec * 1000)
|
(tm.tm_sec * 1000)
|
||||||
+ (tm->tm_min * 60000)
|
+ (tm.tm_min * 60000)
|
||||||
+ (tm->tm_hour * 3600000));
|
+ (tm.tm_hour * 3600000));
|
||||||
bgp_show_peer_reset(NULL, p, json_neigh, true);
|
bgp_show_peer_reset(NULL, p, json_neigh, true);
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, " Last reset %s, ",
|
vty_out(vty, " Last reset %s, ",
|
||||||
@ -16609,8 +16605,6 @@ void bgp_vty_init(void)
|
|||||||
install_element(BGP_IPV6_NODE, &af_no_rd_vpn_export_cmd);
|
install_element(BGP_IPV6_NODE, &af_no_rd_vpn_export_cmd);
|
||||||
install_element(BGP_IPV4_NODE, &af_no_label_vpn_export_cmd);
|
install_element(BGP_IPV4_NODE, &af_no_label_vpn_export_cmd);
|
||||||
install_element(BGP_IPV6_NODE, &af_no_label_vpn_export_cmd);
|
install_element(BGP_IPV6_NODE, &af_no_label_vpn_export_cmd);
|
||||||
install_element(BGP_IPV4_NODE, &af_no_nexthop_vpn_export_cmd);
|
|
||||||
install_element(BGP_IPV6_NODE, &af_no_nexthop_vpn_export_cmd);
|
|
||||||
install_element(BGP_IPV4_NODE, &af_no_rt_vpn_imexport_cmd);
|
install_element(BGP_IPV4_NODE, &af_no_rt_vpn_imexport_cmd);
|
||||||
install_element(BGP_IPV6_NODE, &af_no_rt_vpn_imexport_cmd);
|
install_element(BGP_IPV6_NODE, &af_no_rt_vpn_imexport_cmd);
|
||||||
install_element(BGP_IPV4_NODE, &af_no_route_map_vpn_imexport_cmd);
|
install_element(BGP_IPV4_NODE, &af_no_route_map_vpn_imexport_cmd);
|
||||||
|
@ -72,8 +72,9 @@ static inline int bgp_install_info_to_zebra(struct bgp *bgp)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
zlog_debug("%s: No zebra instance to talk to, not installing information",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: No zebra instance to talk to, not installing information",
|
||||||
|
__func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1918,8 +1919,9 @@ int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni)
|
|||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zebra instance to talk to, cannot advertise subnet",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: No zebra instance to talk to, cannot advertise subnet",
|
||||||
|
__func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1968,8 +1970,9 @@ int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)
|
|||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zebra instance to talk to, not installing gw_macip",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: No zebra instance to talk to, not installing gw_macip",
|
||||||
|
__func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1996,8 +1999,9 @@ int bgp_zebra_vxlan_flood_control(struct bgp *bgp,
|
|||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zebra instance to talk to, not installing all vni",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: No zebra instance to talk to, not installing all vni",
|
||||||
|
__func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2092,7 +2096,7 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
if (!bgp_pbr && note != ZAPI_RULE_REMOVED) {
|
if (!bgp_pbr && note != ZAPI_RULE_REMOVED) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Fail to look BGP rule (%u)",
|
zlog_debug("%s: Fail to look BGP rule (%u)",
|
||||||
__PRETTY_FUNCTION__, unique);
|
__func__, unique);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2100,8 +2104,7 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
switch (note) {
|
switch (note) {
|
||||||
case ZAPI_RULE_FAIL_INSTALL:
|
case ZAPI_RULE_FAIL_INSTALL:
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received RULE_FAIL_INSTALL",
|
zlog_debug("%s: Received RULE_FAIL_INSTALL", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
if (bgp_pbra) {
|
if (bgp_pbra) {
|
||||||
bgp_pbra->installed = false;
|
bgp_pbra->installed = false;
|
||||||
bgp_pbra->install_in_progress = false;
|
bgp_pbra->install_in_progress = false;
|
||||||
@ -2128,14 +2131,12 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
bgp_pbr);
|
bgp_pbr);
|
||||||
}
|
}
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received RULE_INSTALLED",
|
zlog_debug("%s: Received RULE_INSTALLED", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
break;
|
break;
|
||||||
case ZAPI_RULE_FAIL_REMOVE:
|
case ZAPI_RULE_FAIL_REMOVE:
|
||||||
case ZAPI_RULE_REMOVED:
|
case ZAPI_RULE_REMOVED:
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received RULE REMOVED",
|
zlog_debug("%s: Received RULE REMOVED", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2157,15 +2158,14 @@ static int ipset_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
if (!bgp_pbim) {
|
if (!bgp_pbim) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Fail to look BGP match ( %u, ID %u)",
|
zlog_debug("%s: Fail to look BGP match ( %u, ID %u)",
|
||||||
__PRETTY_FUNCTION__, note, unique);
|
__func__, note, unique);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (note) {
|
switch (note) {
|
||||||
case ZAPI_IPSET_FAIL_INSTALL:
|
case ZAPI_IPSET_FAIL_INSTALL:
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPSET_FAIL_INSTALL",
|
zlog_debug("%s: Received IPSET_FAIL_INSTALL", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
bgp_pbim->installed = false;
|
bgp_pbim->installed = false;
|
||||||
bgp_pbim->install_in_progress = false;
|
bgp_pbim->install_in_progress = false;
|
||||||
break;
|
break;
|
||||||
@ -2173,14 +2173,12 @@ static int ipset_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
bgp_pbim->installed = true;
|
bgp_pbim->installed = true;
|
||||||
bgp_pbim->install_in_progress = false;
|
bgp_pbim->install_in_progress = false;
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPSET_INSTALLED",
|
zlog_debug("%s: Received IPSET_INSTALLED", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
break;
|
break;
|
||||||
case ZAPI_IPSET_FAIL_REMOVE:
|
case ZAPI_IPSET_FAIL_REMOVE:
|
||||||
case ZAPI_IPSET_REMOVED:
|
case ZAPI_IPSET_REMOVED:
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPSET REMOVED",
|
zlog_debug("%s: Received IPSET REMOVED", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2205,8 +2203,9 @@ static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
unique);
|
unique);
|
||||||
if (!bgp_pbime) {
|
if (!bgp_pbime) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Fail to look BGP match entry (%u, ID %u)",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, note, unique);
|
"%s: Fail to look BGP match entry (%u, ID %u)",
|
||||||
|
__func__, note, unique);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2214,7 +2213,7 @@ static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
case ZAPI_IPSET_ENTRY_FAIL_INSTALL:
|
case ZAPI_IPSET_ENTRY_FAIL_INSTALL:
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPSET_ENTRY_FAIL_INSTALL",
|
zlog_debug("%s: Received IPSET_ENTRY_FAIL_INSTALL",
|
||||||
__PRETTY_FUNCTION__);
|
__func__);
|
||||||
bgp_pbime->installed = false;
|
bgp_pbime->installed = false;
|
||||||
bgp_pbime->install_in_progress = false;
|
bgp_pbime->install_in_progress = false;
|
||||||
break;
|
break;
|
||||||
@ -2227,7 +2226,7 @@ static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
bgp_pbime->install_in_progress = false;
|
bgp_pbime->install_in_progress = false;
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPSET_ENTRY_INSTALLED",
|
zlog_debug("%s: Received IPSET_ENTRY_INSTALLED",
|
||||||
__PRETTY_FUNCTION__);
|
__func__);
|
||||||
/* link bgp_path_info to bpme */
|
/* link bgp_path_info to bpme */
|
||||||
path = (struct bgp_path_info *)bgp_pbime->path;
|
path = (struct bgp_path_info *)bgp_pbime->path;
|
||||||
extra = bgp_path_info_extra_get(path);
|
extra = bgp_path_info_extra_get(path);
|
||||||
@ -2238,7 +2237,7 @@ static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
case ZAPI_IPSET_ENTRY_REMOVED:
|
case ZAPI_IPSET_ENTRY_REMOVED:
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPSET_ENTRY_REMOVED",
|
zlog_debug("%s: Received IPSET_ENTRY_REMOVED",
|
||||||
__PRETTY_FUNCTION__);
|
__func__);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -2259,14 +2258,14 @@ static int iptable_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
if (!bgpm) {
|
if (!bgpm) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Fail to look BGP iptable (%u %u)",
|
zlog_debug("%s: Fail to look BGP iptable (%u %u)",
|
||||||
__PRETTY_FUNCTION__, note, unique);
|
__func__, note, unique);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
switch (note) {
|
switch (note) {
|
||||||
case ZAPI_IPTABLE_FAIL_INSTALL:
|
case ZAPI_IPTABLE_FAIL_INSTALL:
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPTABLE_FAIL_INSTALL",
|
zlog_debug("%s: Received IPTABLE_FAIL_INSTALL",
|
||||||
__PRETTY_FUNCTION__);
|
__func__);
|
||||||
bgpm->installed_in_iptable = false;
|
bgpm->installed_in_iptable = false;
|
||||||
bgpm->install_iptable_in_progress = false;
|
bgpm->install_iptable_in_progress = false;
|
||||||
break;
|
break;
|
||||||
@ -2274,15 +2273,13 @@ static int iptable_notify_owner(ZAPI_CALLBACK_ARGS)
|
|||||||
bgpm->installed_in_iptable = true;
|
bgpm->installed_in_iptable = true;
|
||||||
bgpm->install_iptable_in_progress = false;
|
bgpm->install_iptable_in_progress = false;
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPTABLE_INSTALLED",
|
zlog_debug("%s: Received IPTABLE_INSTALLED", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
bgpm->action->refcnt++;
|
bgpm->action->refcnt++;
|
||||||
break;
|
break;
|
||||||
case ZAPI_IPTABLE_FAIL_REMOVE:
|
case ZAPI_IPTABLE_FAIL_REMOVE:
|
||||||
case ZAPI_IPTABLE_REMOVED:
|
case ZAPI_IPTABLE_REMOVED:
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Received IPTABLE REMOVED",
|
zlog_debug("%s: Received IPTABLE REMOVED", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -2786,12 +2783,10 @@ void bgp_send_pbr_rule_action(struct bgp_pbr_action *pbra,
|
|||||||
return;
|
return;
|
||||||
if (BGP_DEBUG(zebra, ZEBRA)) {
|
if (BGP_DEBUG(zebra, ZEBRA)) {
|
||||||
if (pbr)
|
if (pbr)
|
||||||
zlog_debug("%s: table %d (ip rule) %d",
|
zlog_debug("%s: table %d (ip rule) %d", __func__,
|
||||||
__PRETTY_FUNCTION__,
|
|
||||||
pbra->table_id, install);
|
pbra->table_id, install);
|
||||||
else
|
else
|
||||||
zlog_debug("%s: table %d fwmark %d %d",
|
zlog_debug("%s: table %d fwmark %d %d", __func__,
|
||||||
__PRETTY_FUNCTION__,
|
|
||||||
pbra->table_id, pbra->fwmark, install);
|
pbra->table_id, pbra->fwmark, install);
|
||||||
}
|
}
|
||||||
s = zclient->obuf;
|
s = zclient->obuf;
|
||||||
@ -2820,10 +2815,9 @@ void bgp_send_pbr_ipset_match(struct bgp_pbr_match *pbrim, bool install)
|
|||||||
if (pbrim->install_in_progress)
|
if (pbrim->install_in_progress)
|
||||||
return;
|
return;
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: name %s type %d %d, ID %u",
|
zlog_debug("%s: name %s type %d %d, ID %u", __func__,
|
||||||
__PRETTY_FUNCTION__,
|
pbrim->ipset_name, pbrim->type, install,
|
||||||
pbrim->ipset_name, pbrim->type,
|
pbrim->unique);
|
||||||
install, pbrim->unique);
|
|
||||||
s = zclient->obuf;
|
s = zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
@ -2849,9 +2843,9 @@ void bgp_send_pbr_ipset_entry_match(struct bgp_pbr_match_entry *pbrime,
|
|||||||
if (pbrime->install_in_progress)
|
if (pbrime->install_in_progress)
|
||||||
return;
|
return;
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: name %s %d %d, ID %u", __PRETTY_FUNCTION__,
|
zlog_debug("%s: name %s %d %d, ID %u", __func__,
|
||||||
pbrime->backpointer->ipset_name,
|
pbrime->backpointer->ipset_name, pbrime->unique,
|
||||||
pbrime->unique, install, pbrime->unique);
|
install, pbrime->unique);
|
||||||
s = zclient->obuf;
|
s = zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
@ -2916,9 +2910,8 @@ void bgp_send_pbr_iptable(struct bgp_pbr_action *pba,
|
|||||||
if (pbm->install_iptable_in_progress)
|
if (pbm->install_iptable_in_progress)
|
||||||
return;
|
return;
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: name %s type %d mark %d %d, ID %u",
|
zlog_debug("%s: name %s type %d mark %d %d, ID %u", __func__,
|
||||||
__PRETTY_FUNCTION__, pbm->ipset_name,
|
pbm->ipset_name, pbm->type, pba->fwmark, install,
|
||||||
pbm->type, pba->fwmark, install,
|
|
||||||
pbm->unique2);
|
pbm->unique2);
|
||||||
s = zclient->obuf;
|
s = zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
37
bgpd/bgpd.c
37
bgpd/bgpd.c
@ -1200,8 +1200,6 @@ struct peer *peer_new(struct bgp *bgp)
|
|||||||
|
|
||||||
/* bgp argument is absolutely required */
|
/* bgp argument is absolutely required */
|
||||||
assert(bgp);
|
assert(bgp);
|
||||||
if (!bgp)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* Allocate new peer. */
|
/* Allocate new peer. */
|
||||||
peer = XCALLOC(MTYPE_BGP_PEER, sizeof(struct peer));
|
peer = XCALLOC(MTYPE_BGP_PEER, sizeof(struct peer));
|
||||||
@ -3148,7 +3146,7 @@ int bgp_handle_socket(struct bgp *bgp, struct vrf *vrf, vrf_id_t old_vrf_id,
|
|||||||
/*
|
/*
|
||||||
* suppress vrf socket
|
* suppress vrf socket
|
||||||
*/
|
*/
|
||||||
if (create == false) {
|
if (!create) {
|
||||||
bgp_close_vrf_socket(bgp);
|
bgp_close_vrf_socket(bgp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3228,7 +3226,7 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name,
|
|||||||
if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: Registering BGP instance %s to zebra",
|
zlog_debug("%s: Registering BGP instance %s to zebra",
|
||||||
__PRETTY_FUNCTION__, name);
|
__func__, name);
|
||||||
bgp_zebra_instance_register(bgp);
|
bgp_zebra_instance_register(bgp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3400,8 +3398,9 @@ int bgp_delete(struct bgp *bgp)
|
|||||||
/* Deregister from Zebra, if needed */
|
/* Deregister from Zebra, if needed */
|
||||||
if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: deregistering this bgp %s instance from zebra",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, bgp->name);
|
"%s: deregistering this bgp %s instance from zebra",
|
||||||
|
__func__, bgp->name);
|
||||||
bgp_zebra_instance_deregister(bgp);
|
bgp_zebra_instance_deregister(bgp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4032,7 +4031,7 @@ static int peer_flag_modify(struct peer *peer, uint32_t flag, int set)
|
|||||||
struct peer_flag_action action;
|
struct peer_flag_action action;
|
||||||
|
|
||||||
memset(&action, 0, sizeof(struct peer_flag_action));
|
memset(&action, 0, sizeof(struct peer_flag_action));
|
||||||
size = sizeof peer_flag_action_list / sizeof(struct peer_flag_action);
|
size = sizeof(peer_flag_action_list) / sizeof(struct peer_flag_action);
|
||||||
|
|
||||||
invert = CHECK_FLAG(peer->flags_invert, flag);
|
invert = CHECK_FLAG(peer->flags_invert, flag);
|
||||||
found = peer_flag_action_set(peer_flag_action_list, size, &action,
|
found = peer_flag_action_set(peer_flag_action_list, size, &action,
|
||||||
@ -4138,7 +4137,7 @@ static int peer_af_flag_modify(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
bgp_peer_sort_t ptype;
|
bgp_peer_sort_t ptype;
|
||||||
|
|
||||||
memset(&action, 0, sizeof(struct peer_flag_action));
|
memset(&action, 0, sizeof(struct peer_flag_action));
|
||||||
size = sizeof peer_af_flag_action_list
|
size = sizeof(peer_af_flag_action_list)
|
||||||
/ sizeof(struct peer_flag_action);
|
/ sizeof(struct peer_flag_action);
|
||||||
|
|
||||||
invert = CHECK_FLAG(peer->af_flags_invert[afi][safi], flag);
|
invert = CHECK_FLAG(peer->af_flags_invert[afi][safi], flag);
|
||||||
@ -6848,7 +6847,7 @@ char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
|
|||||||
json_object *json)
|
json_object *json)
|
||||||
{
|
{
|
||||||
time_t uptime1, epoch_tbuf;
|
time_t uptime1, epoch_tbuf;
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
|
|
||||||
/* If there is no connection has been done before print `never'. */
|
/* If there is no connection has been done before print `never'. */
|
||||||
if (uptime2 == 0) {
|
if (uptime2 == 0) {
|
||||||
@ -6863,21 +6862,21 @@ char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
|
|||||||
/* Get current time. */
|
/* Get current time. */
|
||||||
uptime1 = bgp_clock();
|
uptime1 = bgp_clock();
|
||||||
uptime1 -= uptime2;
|
uptime1 -= uptime2;
|
||||||
tm = gmtime(&uptime1);
|
gmtime_r(&uptime1, &tm);
|
||||||
|
|
||||||
if (uptime1 < ONE_DAY_SECOND)
|
if (uptime1 < ONE_DAY_SECOND)
|
||||||
snprintf(buf, len, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min,
|
snprintf(buf, len, "%02d:%02d:%02d", tm.tm_hour, tm.tm_min,
|
||||||
tm->tm_sec);
|
tm.tm_sec);
|
||||||
else if (uptime1 < ONE_WEEK_SECOND)
|
else if (uptime1 < ONE_WEEK_SECOND)
|
||||||
snprintf(buf, len, "%dd%02dh%02dm", tm->tm_yday, tm->tm_hour,
|
snprintf(buf, len, "%dd%02dh%02dm", tm.tm_yday, tm.tm_hour,
|
||||||
tm->tm_min);
|
tm.tm_min);
|
||||||
else if (uptime1 < ONE_YEAR_SECOND)
|
else if (uptime1 < ONE_YEAR_SECOND)
|
||||||
snprintf(buf, len, "%02dw%dd%02dh", tm->tm_yday / 7,
|
snprintf(buf, len, "%02dw%dd%02dh", tm.tm_yday / 7,
|
||||||
tm->tm_yday - ((tm->tm_yday / 7) * 7), tm->tm_hour);
|
tm.tm_yday - ((tm.tm_yday / 7) * 7), tm.tm_hour);
|
||||||
else
|
else
|
||||||
snprintf(buf, len, "%02dy%02dw%dd", tm->tm_year - 70,
|
snprintf(buf, len, "%02dy%02dw%dd", tm.tm_year - 70,
|
||||||
tm->tm_yday / 7,
|
tm.tm_yday / 7,
|
||||||
tm->tm_yday - ((tm->tm_yday / 7) * 7));
|
tm.tm_yday - ((tm.tm_yday / 7) * 7));
|
||||||
|
|
||||||
if (use_json) {
|
if (use_json) {
|
||||||
epoch_tbuf = time(NULL) - uptime1;
|
epoch_tbuf = time(NULL) - uptime1;
|
||||||
|
@ -2184,6 +2184,7 @@ void rfapiRibPendingDeleteRoute(struct bgp *bgp, struct rfapi_import_table *it,
|
|||||||
rfapiRibUpdatePendingNode(
|
rfapiRibUpdatePendingNode(
|
||||||
bgp, m->rfd, it, it_node,
|
bgp, m->rfd, it, it_node,
|
||||||
m->rfd->response_lifetime);
|
m->rfd->response_lifetime);
|
||||||
|
agg_unlock_node(rn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ Definition Grammar
|
|||||||
FRR uses its own grammar for defining CLI commands. The grammar draws from
|
FRR uses its own grammar for defining CLI commands. The grammar draws from
|
||||||
syntax commonly seen in \*nix manpages and should be fairly intuitive. The
|
syntax commonly seen in \*nix manpages and should be fairly intuitive. The
|
||||||
parser is implemented in Bison and the lexer in Flex. These may be found in
|
parser is implemented in Bison and the lexer in Flex. These may be found in
|
||||||
``lib/command_lex.l`` and ``lib/command_parse.y``, respectively.
|
``lib/command_parse.y`` and ``lib/command_lex.l``, respectively.
|
||||||
|
|
||||||
**ProTip**: if you define a new command and find that the parser is
|
**ProTip**: if you define a new command and find that the parser is
|
||||||
throwing syntax or other errors, the parser is the last place you want
|
throwing syntax or other errors, the parser is the last place you want
|
||||||
|
@ -192,7 +192,7 @@ html_theme = 'default'
|
|||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = []
|
||||||
|
|
||||||
# Add any extra paths that contain custom files (such as robots.txt or
|
# Add any extra paths that contain custom files (such as robots.txt or
|
||||||
# .htaccess) here, relative to this directory. These files are copied
|
# .htaccess) here, relative to this directory. These files are copied
|
||||||
|
@ -1215,6 +1215,14 @@ Configuring Peers
|
|||||||
keyword `all` is specified the modification is done also for routes learned
|
keyword `all` is specified the modification is done also for routes learned
|
||||||
via iBGP.
|
via iBGP.
|
||||||
|
|
||||||
|
.. index:: neighbor PEER attribute-unchanged [{as-path|next-hop|med}]
|
||||||
|
.. clicmd:: neighbor PEER attribute-unchanged [{as-path|next-hop|med}]
|
||||||
|
|
||||||
|
This command specifies attributes to be left unchanged for advertisements
|
||||||
|
sent to a peer. Use this to leave the next-hop unchanged in ipv6
|
||||||
|
configurations, as the route-map directive to leave the next-hop unchanged
|
||||||
|
is only available for ipv4.
|
||||||
|
|
||||||
.. index:: [no] neighbor PEER update-source <IFNAME|ADDRESS>
|
.. index:: [no] neighbor PEER update-source <IFNAME|ADDRESS>
|
||||||
.. clicmd:: [no] neighbor PEER update-source <IFNAME|ADDRESS>
|
.. clicmd:: [no] neighbor PEER update-source <IFNAME|ADDRESS>
|
||||||
|
|
||||||
|
@ -292,6 +292,8 @@ BGP
|
|||||||
:t:`BGP/MPLS IP Virtual Private Networks (VPNs). Y. Rekhter. Feb 2006.`
|
:t:`BGP/MPLS IP Virtual Private Networks (VPNs). Y. Rekhter. Feb 2006.`
|
||||||
- :rfc:`4659`
|
- :rfc:`4659`
|
||||||
:t:`BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN. J. De Clercq, D. Ooms, M. Carugi, F. Le Faucheur. September 2006.`
|
:t:`BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN. J. De Clercq, D. Ooms, M. Carugi, F. Le Faucheur. September 2006.`
|
||||||
|
- :rfc:`4893`
|
||||||
|
:t:`BGP Support for Four-octet AS Number Space. Q. Vohra, E. Chen May 2007.`
|
||||||
- :rfc:`5004`
|
- :rfc:`5004`
|
||||||
:t:`Avoid BGP Best Path Transitions from One External to Another. E. Chen & S. Sangli. September 2007 (Partial support).`
|
:t:`Avoid BGP Best Path Transitions from One External to Another. E. Chen & S. Sangli. September 2007 (Partial support).`
|
||||||
- :rfc:`5082`
|
- :rfc:`5082`
|
||||||
@ -445,4 +447,4 @@ For information on reporting bugs, please see :ref:`bug-reports`.
|
|||||||
.. _frr: |package-url|
|
.. _frr: |package-url|
|
||||||
.. _github: https://github.com/frrouting/frr/
|
.. _github: https://github.com/frrouting/frr/
|
||||||
.. _github issues: https://github.com/frrouting/frr/issues
|
.. _github issues: https://github.com/frrouting/frr/issues
|
||||||
.. _slack: https://frrouting.slack.com/
|
.. _slack: https://frrouting.org/#participate
|
||||||
|
@ -174,6 +174,13 @@ PIM interface commands allow you to configure an interface as either a Receiver
|
|||||||
or a interface that you would like to form pim neighbors on. If the interface
|
or a interface that you would like to form pim neighbors on. If the interface
|
||||||
is in a vrf, enter the interface command with the vrf keyword at the end.
|
is in a vrf, enter the interface command with the vrf keyword at the end.
|
||||||
|
|
||||||
|
.. index:: ip pim active-active
|
||||||
|
.. clicmd:: ip pim active-active
|
||||||
|
|
||||||
|
Turn on pim active-active configuration for a Vxlan interface. This
|
||||||
|
command will not do anything if you do not have the underlying ability
|
||||||
|
of a mlag implementation.
|
||||||
|
|
||||||
.. index:: ip pim bfd
|
.. index:: ip pim bfd
|
||||||
.. clicmd:: ip pim bfd
|
.. clicmd:: ip pim bfd
|
||||||
|
|
||||||
@ -392,6 +399,11 @@ cause great confusion.
|
|||||||
|
|
||||||
Display information about interfaces PIM is using.
|
Display information about interfaces PIM is using.
|
||||||
|
|
||||||
|
.. index:: show ip pim mlag [vrf NAME] interface [detail|WORD] [json]
|
||||||
|
.. clicmd:: show ip pim mlag [vrf NAME|all] interface [detail|WORD] [json]
|
||||||
|
|
||||||
|
Display mlag interface information.
|
||||||
|
|
||||||
.. index:: show ip pim [vrf NAME] join [A.B.C.D [A.B.C.D]] [json]
|
.. index:: show ip pim [vrf NAME] join [A.B.C.D [A.B.C.D]] [json]
|
||||||
.. clicmd:: show ip pim join
|
.. clicmd:: show ip pim join
|
||||||
|
|
||||||
@ -404,6 +416,11 @@ cause great confusion.
|
|||||||
|
|
||||||
Display information about PIM interface local-membership.
|
Display information about PIM interface local-membership.
|
||||||
|
|
||||||
|
.. index:: show ip pim mlag summary [json]
|
||||||
|
.. clicmd:: show ip pim mlag summary [json]
|
||||||
|
|
||||||
|
Display mlag information state that PIM is keeping track of.
|
||||||
|
|
||||||
.. index:: show ip pim neighbor
|
.. index:: show ip pim neighbor
|
||||||
.. clicmd:: show ip pim neighbor
|
.. clicmd:: show ip pim neighbor
|
||||||
|
|
||||||
|
@ -273,6 +273,16 @@ Route Map Set Command
|
|||||||
|
|
||||||
Set the BGP local preference to `local_pref`.
|
Set the BGP local preference to `local_pref`.
|
||||||
|
|
||||||
|
.. index:: set local-preference +LOCAL_PREF
|
||||||
|
.. clicmd:: set local-preference +LOCAL_PREF
|
||||||
|
|
||||||
|
Add the BGP local preference to an existing `local_pref`.
|
||||||
|
|
||||||
|
.. index:: set local-preference -LOCAL_PREF
|
||||||
|
.. clicmd:: set local-preference -LOCAL_PREF
|
||||||
|
|
||||||
|
Subtract the BGP local preference from an existing `local_pref`.
|
||||||
|
|
||||||
.. index:: [no] set distance DISTANCE
|
.. index:: [no] set distance DISTANCE
|
||||||
.. clicmd:: [no] set distance DISTANCE
|
.. clicmd:: [no] set distance DISTANCE
|
||||||
|
|
||||||
|
@ -200,6 +200,18 @@ Debugging
|
|||||||
Displaying RPKI
|
Displaying RPKI
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
.. index:: show rpki prefix <A.B.C.D/M|X:X::X:X/M> [(1-4294967295)]
|
||||||
|
.. clicmd:: show rpki prefix <A.B.C.D/M|X:X::X:X/M> [(1-4294967295)]
|
||||||
|
|
||||||
|
Display validated prefixes received from the cache servers filtered
|
||||||
|
by the specified prefix.
|
||||||
|
|
||||||
|
.. index:: show rpki as-number ASN
|
||||||
|
.. clicmd:: show rpki as-number ASN
|
||||||
|
|
||||||
|
Display validated prefixes received from the cache servers filtered
|
||||||
|
by ASN.
|
||||||
|
|
||||||
.. index:: show rpki prefix-table
|
.. index:: show rpki prefix-table
|
||||||
.. clicmd:: show rpki prefix-table
|
.. clicmd:: show rpki prefix-table
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ macvlan device. If you are using ``iproute2``, the equivalent configuration is:
|
|||||||
ip link set dev vrrp4-2-1 up
|
ip link set dev vrrp4-2-1 up
|
||||||
|
|
||||||
ip link add vrrp6-2-1 link eth0 addrgenmode random type macvlan mode bridge
|
ip link add vrrp6-2-1 link eth0 addrgenmode random type macvlan mode bridge
|
||||||
ip link set dev vrrp4-2-1 address 00:00:5e:00:02:05
|
ip link set dev vrrp6-2-1 address 00:00:5e:00:02:05
|
||||||
ip addr add 2001:db8::370:7334/64 dev vrrp6-2-1
|
ip addr add 2001:db8::370:7334/64 dev vrrp6-2-1
|
||||||
ip link set dev vrrp6-2-1 up
|
ip link set dev vrrp6-2-1 up
|
||||||
|
|
||||||
|
@ -351,13 +351,13 @@ int eigrp_write(struct thread *thread)
|
|||||||
ep = eigrp_fifo_next(ei->obuf);
|
ep = eigrp_fifo_next(ei->obuf);
|
||||||
if (!ep) {
|
if (!ep) {
|
||||||
flog_err(EC_LIB_DEVELOPMENT,
|
flog_err(EC_LIB_DEVELOPMENT,
|
||||||
"%s: Interface %s no packet on queue?",
|
"%s: Interface %s no packet on queue?", __func__,
|
||||||
__PRETTY_FUNCTION__, ei->ifp->name);
|
ei->ifp->name);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (ep->length < EIGRP_HEADER_LEN) {
|
if (ep->length < EIGRP_HEADER_LEN) {
|
||||||
flog_err(EC_EIGRP_PACKET, "%s: Packet just has a header?",
|
flog_err(EC_EIGRP_PACKET, "%s: Packet just has a header?",
|
||||||
__PRETTY_FUNCTION__);
|
__func__);
|
||||||
eigrp_header_dump((struct eigrp_header *)ep->s->data);
|
eigrp_header_dump((struct eigrp_header *)ep->s->data);
|
||||||
eigrp_packet_delete(ei);
|
eigrp_packet_delete(ei);
|
||||||
goto out;
|
goto out;
|
||||||
@ -1205,7 +1205,7 @@ uint16_t eigrp_add_internalTLV_to_stream(struct stream *s,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
flog_err(EC_LIB_DEVELOPMENT, "%s: Unexpected prefix length: %d",
|
flog_err(EC_LIB_DEVELOPMENT, "%s: Unexpected prefix length: %d",
|
||||||
__PRETTY_FUNCTION__, pe->destination->prefixlen);
|
__func__, pe->destination->prefixlen);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
stream_putl(s, 0x00000000);
|
stream_putl(s, 0x00000000);
|
||||||
|
@ -173,7 +173,7 @@ void eigrp_reply_receive(struct eigrp *eigrp, struct ip *iph,
|
|||||||
flog_err(
|
flog_err(
|
||||||
EC_EIGRP_PACKET,
|
EC_EIGRP_PACKET,
|
||||||
"%s: Received prefix %s which we do not know about",
|
"%s: Received prefix %s which we do not know about",
|
||||||
__PRETTY_FUNCTION__,
|
__func__,
|
||||||
prefix2str(&dest_addr, buf, sizeof(buf)));
|
prefix2str(&dest_addr, buf, sizeof(buf)));
|
||||||
eigrp_IPv4_InternalTLV_free(tlv);
|
eigrp_IPv4_InternalTLV_free(tlv);
|
||||||
continue;
|
continue;
|
||||||
|
@ -295,7 +295,7 @@ static void *route_match_metric_compile(const char *arg)
|
|||||||
{
|
{
|
||||||
// uint32_t *metric;
|
// uint32_t *metric;
|
||||||
//
|
//
|
||||||
// metric = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (uint32_t));
|
// metric = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof(uint32_t));
|
||||||
// *metric = atoi (arg);
|
// *metric = atoi (arg);
|
||||||
//
|
//
|
||||||
// if(*metric > 0)
|
// if(*metric > 0)
|
||||||
@ -574,7 +574,7 @@ static void *route_match_tag_compile(const char *arg)
|
|||||||
{
|
{
|
||||||
// unsigned short *tag;
|
// unsigned short *tag;
|
||||||
//
|
//
|
||||||
// tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (unsigned short));
|
// tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof(unsigned short));
|
||||||
// *tag = atoi (arg);
|
// *tag = atoi (arg);
|
||||||
//
|
//
|
||||||
// return tag;
|
// return tag;
|
||||||
@ -667,7 +667,7 @@ static void *route_set_metric_compile(const char *arg)
|
|||||||
// return NULL;*/
|
// return NULL;*/
|
||||||
//
|
//
|
||||||
// mod = XMALLOC (MTYPE_ROUTE_MAP_COMPILED,
|
// mod = XMALLOC (MTYPE_ROUTE_MAP_COMPILED,
|
||||||
// sizeof (struct rip_metric_modifier));
|
// sizeof(struct rip_metric_modifier));
|
||||||
// mod->type = type;
|
// mod->type = type;
|
||||||
// mod->metric = metric;
|
// mod->metric = metric;
|
||||||
|
|
||||||
@ -718,7 +718,7 @@ static void *route_set_ip_nexthop_compile(const char *arg)
|
|||||||
// int ret;
|
// int ret;
|
||||||
// struct in_addr *address;
|
// struct in_addr *address;
|
||||||
//
|
//
|
||||||
// address = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (struct
|
// address = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof(struct
|
||||||
// in_addr));
|
// in_addr));
|
||||||
//
|
//
|
||||||
// ret = inet_aton (arg, address);
|
// ret = inet_aton (arg, address);
|
||||||
@ -775,7 +775,7 @@ static void *route_set_tag_compile(const char *arg)
|
|||||||
{
|
{
|
||||||
// unsigned short *tag;
|
// unsigned short *tag;
|
||||||
//
|
//
|
||||||
// tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (unsigned short));
|
// tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof(unsigned short));
|
||||||
// *tag = atoi (arg);
|
// *tag = atoi (arg);
|
||||||
//
|
//
|
||||||
// return tag;
|
// return tag;
|
||||||
|
@ -138,7 +138,7 @@ void eigrp_prefix_entry_add(struct route_table *topology,
|
|||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: %s Should we have found this entry in the topo table?",
|
"%s: %s Should we have found this entry in the topo table?",
|
||||||
__PRETTY_FUNCTION__,
|
__func__,
|
||||||
prefix2str(pe->destination, buf, sizeof(buf)));
|
prefix2str(pe->destination, buf, sizeof(buf)));
|
||||||
}
|
}
|
||||||
route_unlock_node(rn);
|
route_unlock_node(rn);
|
||||||
@ -402,7 +402,7 @@ eigrp_topology_update_distance(struct eigrp_fsm_action_message *msg)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
flog_err(EC_LIB_DEVELOPMENT, "%s: Please implement handler",
|
flog_err(EC_LIB_DEVELOPMENT, "%s: Please implement handler",
|
||||||
__PRETTY_FUNCTION__);
|
__func__);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
distance_done:
|
distance_done:
|
||||||
|
@ -175,7 +175,7 @@ static inline size_t fpm_msg_align(size_t len)
|
|||||||
* The (rounded up) size of the FPM message header. This ensures that
|
* The (rounded up) size of the FPM message header. This ensures that
|
||||||
* the message payload always starts at an aligned address.
|
* the message payload always starts at an aligned address.
|
||||||
*/
|
*/
|
||||||
#define FPM_MSG_HDR_LEN (sizeof (fpm_msg_hdr_t))
|
#define FPM_MSG_HDR_LEN (sizeof(fpm_msg_hdr_t))
|
||||||
|
|
||||||
#ifndef COMPILE_ASSERT
|
#ifndef COMPILE_ASSERT
|
||||||
#define COMPILE_ASSERT(x) extern int __dummy[2 * !!(x) - 1]
|
#define COMPILE_ASSERT(x) extern int __dummy[2 * !!(x) - 1]
|
||||||
|
@ -562,19 +562,20 @@ void vty_multiline(struct vty *vty, const char *prefix, const char *format, ...)
|
|||||||
|
|
||||||
void vty_out_timestr(struct vty *vty, time_t uptime)
|
void vty_out_timestr(struct vty *vty, time_t uptime)
|
||||||
{
|
{
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
time_t difftime = time(NULL);
|
time_t difftime = time(NULL);
|
||||||
difftime -= uptime;
|
difftime -= uptime;
|
||||||
tm = gmtime(&difftime);
|
|
||||||
|
gmtime_r(&difftime, &tm);
|
||||||
|
|
||||||
if (difftime < ONE_DAY_SECOND)
|
if (difftime < ONE_DAY_SECOND)
|
||||||
vty_out(vty, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min,
|
vty_out(vty, "%02d:%02d:%02d", tm.tm_hour, tm.tm_min,
|
||||||
tm->tm_sec);
|
tm.tm_sec);
|
||||||
else if (difftime < ONE_WEEK_SECOND)
|
else if (difftime < ONE_WEEK_SECOND)
|
||||||
vty_out(vty, "%dd%02dh%02dm", tm->tm_yday, tm->tm_hour,
|
vty_out(vty, "%dd%02dh%02dm", tm.tm_yday, tm.tm_hour,
|
||||||
tm->tm_min);
|
tm.tm_min);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%02dw%dd%02dh", tm->tm_yday / 7,
|
vty_out(vty, "%02dw%dd%02dh", tm.tm_yday / 7,
|
||||||
tm->tm_yday - ((tm->tm_yday / 7) * 7), tm->tm_hour);
|
tm.tm_yday - ((tm.tm_yday / 7) * 7), tm.tm_hour);
|
||||||
vty_out(vty, " ago");
|
vty_out(vty, " ago");
|
||||||
}
|
}
|
||||||
|
@ -129,18 +129,20 @@ static void lsp_print_flooding(struct vty *vty, struct isis_lsp *lsp)
|
|||||||
lsp->flooding_interface : "(null)");
|
lsp->flooding_interface : "(null)");
|
||||||
|
|
||||||
time_t uptime = time(NULL) - lsp->flooding_time;
|
time_t uptime = time(NULL) - lsp->flooding_time;
|
||||||
struct tm *tm = gmtime(&uptime);
|
struct tm tm;
|
||||||
|
|
||||||
|
gmtime_r(&uptime, &tm);
|
||||||
|
|
||||||
if (uptime < ONE_DAY_SECOND)
|
if (uptime < ONE_DAY_SECOND)
|
||||||
vty_out(vty, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min,
|
vty_out(vty, "%02d:%02d:%02d", tm.tm_hour, tm.tm_min,
|
||||||
tm->tm_sec);
|
tm.tm_sec);
|
||||||
else if (uptime < ONE_WEEK_SECOND)
|
else if (uptime < ONE_WEEK_SECOND)
|
||||||
vty_out(vty, "%dd%02dh%02dm", tm->tm_yday, tm->tm_hour,
|
vty_out(vty, "%dd%02dh%02dm", tm.tm_yday, tm.tm_hour,
|
||||||
tm->tm_min);
|
tm.tm_min);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%02dw%dd%02dh", tm->tm_yday / 7,
|
vty_out(vty, "%02dw%dd%02dh", tm.tm_yday / 7,
|
||||||
tm->tm_yday - ((tm->tm_yday / 7) * 7),
|
tm.tm_yday - ((tm.tm_yday / 7) * 7),
|
||||||
tm->tm_hour);
|
tm.tm_hour);
|
||||||
vty_out(vty, " ago)\n");
|
vty_out(vty, " ago)\n");
|
||||||
|
|
||||||
if (lsp->flooding_circuit_scoped) {
|
if (lsp->flooding_circuit_scoped) {
|
||||||
|
@ -67,7 +67,7 @@ send_address(struct nbr *nbr, int af, struct if_addr_head *addr_list,
|
|||||||
fatalx("send_address: unknown af");
|
fatalx("send_address: unknown af");
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((if_addr = LIST_FIRST(addr_list)) != NULL) {
|
while (LIST_FIRST(addr_list) != NULL) {
|
||||||
/*
|
/*
|
||||||
* Send as many addresses as possible - respect the session's
|
* Send as many addresses as possible - respect the session's
|
||||||
* negotiated maximum pdu length.
|
* negotiated maximum pdu length.
|
||||||
|
@ -71,9 +71,6 @@ struct nbr_tree lde_nbrs = RB_INITIALIZER(&lde_nbrs);
|
|||||||
static struct imsgev *iev_ldpe;
|
static struct imsgev *iev_ldpe;
|
||||||
static struct imsgev *iev_main, *iev_main_sync;
|
static struct imsgev *iev_main, *iev_main_sync;
|
||||||
|
|
||||||
/* Master of threads. */
|
|
||||||
struct thread_master *master;
|
|
||||||
|
|
||||||
/* lde privileges */
|
/* lde privileges */
|
||||||
static zebra_capabilities_t _caps_p [] =
|
static zebra_capabilities_t _caps_p [] =
|
||||||
{
|
{
|
||||||
|
65
ldpd/ldpd.c
65
ldpd/ldpd.c
@ -86,6 +86,8 @@ static struct imsgev *iev_lde, *iev_lde_sync;
|
|||||||
static pid_t ldpe_pid;
|
static pid_t ldpe_pid;
|
||||||
static pid_t lde_pid;
|
static pid_t lde_pid;
|
||||||
|
|
||||||
|
enum ldpd_process ldpd_process;
|
||||||
|
|
||||||
#define LDP_DEFAULT_CONFIG "ldpd.conf"
|
#define LDP_DEFAULT_CONFIG "ldpd.conf"
|
||||||
#define LDP_VTY_PORT 2612
|
#define LDP_VTY_PORT 2612
|
||||||
|
|
||||||
@ -858,7 +860,6 @@ ldp_acl_request(struct imsgev *iev, char *acl_name, int af,
|
|||||||
union ldpd_addr *addr, uint8_t prefixlen)
|
union ldpd_addr *addr, uint8_t prefixlen)
|
||||||
{
|
{
|
||||||
struct imsg imsg;
|
struct imsg imsg;
|
||||||
ssize_t n;
|
|
||||||
struct acl_check acl_check;
|
struct acl_check acl_check;
|
||||||
|
|
||||||
if (acl_name[0] == '\0')
|
if (acl_name[0] == '\0')
|
||||||
@ -876,9 +877,9 @@ ldp_acl_request(struct imsgev *iev, char *acl_name, int af,
|
|||||||
imsg_flush(&iev->ibuf);
|
imsg_flush(&iev->ibuf);
|
||||||
|
|
||||||
/* receive (blocking) and parse result */
|
/* receive (blocking) and parse result */
|
||||||
if ((n = imsg_read(&iev->ibuf)) == -1)
|
if (imsg_read(&iev->ibuf) == -1)
|
||||||
fatal("imsg_read error");
|
fatal("imsg_read error");
|
||||||
if ((n = imsg_get(&iev->ibuf, &imsg)) == -1)
|
if (imsg_get(&iev->ibuf, &imsg) == -1)
|
||||||
fatal("imsg_get");
|
fatal("imsg_get");
|
||||||
if (imsg.hdr.type != IMSG_ACL_CHECK ||
|
if (imsg.hdr.type != IMSG_ACL_CHECK ||
|
||||||
imsg.hdr.len != IMSG_HEADER_SIZE + sizeof(int))
|
imsg.hdr.len != IMSG_HEADER_SIZE + sizeof(int))
|
||||||
@ -1408,7 +1409,7 @@ merge_ifaces(struct ldpd_conf *conf, struct ldpd_conf *xconf)
|
|||||||
|
|
||||||
RB_FOREACH_SAFE(iface, iface_head, &conf->iface_tree, itmp) {
|
RB_FOREACH_SAFE(iface, iface_head, &conf->iface_tree, itmp) {
|
||||||
/* find deleted interfaces */
|
/* find deleted interfaces */
|
||||||
if ((xi = if_lookup_name(xconf, iface->name)) == NULL) {
|
if (if_lookup_name(xconf, iface->name) == NULL) {
|
||||||
switch (ldpd_process) {
|
switch (ldpd_process) {
|
||||||
case PROC_LDP_ENGINE:
|
case PROC_LDP_ENGINE:
|
||||||
ldpe_if_exit(iface);
|
ldpe_if_exit(iface);
|
||||||
@ -1469,7 +1470,7 @@ merge_tnbrs(struct ldpd_conf *conf, struct ldpd_conf *xconf)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* find deleted tnbrs */
|
/* find deleted tnbrs */
|
||||||
if ((xt = tnbr_find(xconf, tnbr->af, &tnbr->addr)) == NULL) {
|
if (tnbr_find(xconf, tnbr->af, &tnbr->addr) == NULL) {
|
||||||
switch (ldpd_process) {
|
switch (ldpd_process) {
|
||||||
case PROC_LDP_ENGINE:
|
case PROC_LDP_ENGINE:
|
||||||
tnbr->flags &= ~F_TNBR_CONFIGURED;
|
tnbr->flags &= ~F_TNBR_CONFIGURED;
|
||||||
@ -1515,33 +1516,35 @@ merge_nbrps(struct ldpd_conf *conf, struct ldpd_conf *xconf)
|
|||||||
|
|
||||||
RB_FOREACH_SAFE(nbrp, nbrp_head, &conf->nbrp_tree, ntmp) {
|
RB_FOREACH_SAFE(nbrp, nbrp_head, &conf->nbrp_tree, ntmp) {
|
||||||
/* find deleted nbrps */
|
/* find deleted nbrps */
|
||||||
if ((xn = nbr_params_find(xconf, nbrp->lsr_id)) == NULL) {
|
if (nbr_params_find(xconf, nbrp->lsr_id) != NULL)
|
||||||
switch (ldpd_process) {
|
continue;
|
||||||
case PROC_LDP_ENGINE:
|
|
||||||
nbr = nbr_find_ldpid(nbrp->lsr_id.s_addr);
|
switch (ldpd_process) {
|
||||||
if (nbr) {
|
case PROC_LDP_ENGINE:
|
||||||
session_shutdown(nbr, S_SHUTDOWN, 0, 0);
|
nbr = nbr_find_ldpid(nbrp->lsr_id.s_addr);
|
||||||
|
if (nbr) {
|
||||||
|
session_shutdown(nbr, S_SHUTDOWN, 0, 0);
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
pfkey_remove(nbr);
|
pfkey_remove(nbr);
|
||||||
#else
|
#else
|
||||||
sock_set_md5sig(
|
sock_set_md5sig(
|
||||||
(ldp_af_global_get(&global,
|
(ldp_af_global_get(&global, nbr->af))
|
||||||
nbr->af))->ldp_session_socket,
|
->ldp_session_socket,
|
||||||
nbr->af, &nbr->raddr, NULL);
|
nbr->af, &nbr->raddr, NULL);
|
||||||
#endif
|
#endif
|
||||||
nbr->auth.method = AUTH_NONE;
|
nbr->auth.method = AUTH_NONE;
|
||||||
if (nbr_session_active_role(nbr))
|
if (nbr_session_active_role(nbr))
|
||||||
nbr_establish_connection(nbr);
|
nbr_establish_connection(nbr);
|
||||||
}
|
|
||||||
break;
|
|
||||||
case PROC_LDE_ENGINE:
|
|
||||||
case PROC_MAIN:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
RB_REMOVE(nbrp_head, &conf->nbrp_tree, nbrp);
|
break;
|
||||||
free(nbrp);
|
case PROC_LDE_ENGINE:
|
||||||
|
case PROC_MAIN:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
RB_REMOVE(nbrp_head, &conf->nbrp_tree, nbrp);
|
||||||
|
free(nbrp);
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_FOREACH_SAFE(xn, nbrp_head, &xconf->nbrp_tree, ntmp) {
|
RB_FOREACH_SAFE(xn, nbrp_head, &xconf->nbrp_tree, ntmp) {
|
||||||
/* find new nbrps */
|
/* find new nbrps */
|
||||||
if ((nbrp = nbr_params_find(conf, xn->lsr_id)) == NULL) {
|
if ((nbrp = nbr_params_find(conf, xn->lsr_id)) == NULL) {
|
||||||
@ -1624,7 +1627,7 @@ merge_l2vpns(struct ldpd_conf *conf, struct ldpd_conf *xconf)
|
|||||||
|
|
||||||
RB_FOREACH_SAFE(l2vpn, l2vpn_head, &conf->l2vpn_tree, ltmp) {
|
RB_FOREACH_SAFE(l2vpn, l2vpn_head, &conf->l2vpn_tree, ltmp) {
|
||||||
/* find deleted l2vpns */
|
/* find deleted l2vpns */
|
||||||
if ((xl = l2vpn_find(xconf, l2vpn->name)) == NULL) {
|
if (l2vpn_find(xconf, l2vpn->name) == NULL) {
|
||||||
switch (ldpd_process) {
|
switch (ldpd_process) {
|
||||||
case PROC_LDE_ENGINE:
|
case PROC_LDE_ENGINE:
|
||||||
l2vpn_exit(l2vpn);
|
l2vpn_exit(l2vpn);
|
||||||
@ -1680,14 +1683,14 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
|
|||||||
/* merge intefaces */
|
/* merge intefaces */
|
||||||
RB_FOREACH_SAFE(lif, l2vpn_if_head, &l2vpn->if_tree, ftmp) {
|
RB_FOREACH_SAFE(lif, l2vpn_if_head, &l2vpn->if_tree, ftmp) {
|
||||||
/* find deleted interfaces */
|
/* find deleted interfaces */
|
||||||
if ((xf = l2vpn_if_find(xl, lif->ifname)) == NULL) {
|
if (l2vpn_if_find(xl, lif->ifname) == NULL) {
|
||||||
RB_REMOVE(l2vpn_if_head, &l2vpn->if_tree, lif);
|
RB_REMOVE(l2vpn_if_head, &l2vpn->if_tree, lif);
|
||||||
free(lif);
|
free(lif);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RB_FOREACH_SAFE(xf, l2vpn_if_head, &xl->if_tree, ftmp) {
|
RB_FOREACH_SAFE(xf, l2vpn_if_head, &xl->if_tree, ftmp) {
|
||||||
/* find new interfaces */
|
/* find new interfaces */
|
||||||
if ((lif = l2vpn_if_find(l2vpn, xf->ifname)) == NULL) {
|
if (l2vpn_if_find(l2vpn, xf->ifname) == NULL) {
|
||||||
COPY(lif, xf);
|
COPY(lif, xf);
|
||||||
RB_INSERT(l2vpn_if_head, &l2vpn->if_tree, lif);
|
RB_INSERT(l2vpn_if_head, &l2vpn->if_tree, lif);
|
||||||
lif->l2vpn = l2vpn;
|
lif->l2vpn = l2vpn;
|
||||||
@ -1706,7 +1709,7 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
|
|||||||
/* merge active pseudowires */
|
/* merge active pseudowires */
|
||||||
RB_FOREACH_SAFE(pw, l2vpn_pw_head, &l2vpn->pw_tree, ptmp) {
|
RB_FOREACH_SAFE(pw, l2vpn_pw_head, &l2vpn->pw_tree, ptmp) {
|
||||||
/* find deleted active pseudowires */
|
/* find deleted active pseudowires */
|
||||||
if ((xp = l2vpn_pw_find_active(xl, pw->ifname)) == NULL) {
|
if (l2vpn_pw_find_active(xl, pw->ifname) == NULL) {
|
||||||
switch (ldpd_process) {
|
switch (ldpd_process) {
|
||||||
case PROC_LDE_ENGINE:
|
case PROC_LDE_ENGINE:
|
||||||
l2vpn_pw_exit(pw);
|
l2vpn_pw_exit(pw);
|
||||||
@ -1807,7 +1810,7 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
|
|||||||
/* merge inactive pseudowires */
|
/* merge inactive pseudowires */
|
||||||
RB_FOREACH_SAFE(pw, l2vpn_pw_head, &l2vpn->pw_inactive_tree, ptmp) {
|
RB_FOREACH_SAFE(pw, l2vpn_pw_head, &l2vpn->pw_inactive_tree, ptmp) {
|
||||||
/* find deleted inactive pseudowires */
|
/* find deleted inactive pseudowires */
|
||||||
if ((xp = l2vpn_pw_find_inactive(xl, pw->ifname)) == NULL) {
|
if (l2vpn_pw_find_inactive(xl, pw->ifname) == NULL) {
|
||||||
RB_REMOVE(l2vpn_pw_head, &l2vpn->pw_inactive_tree, pw);
|
RB_REMOVE(l2vpn_pw_head, &l2vpn->pw_inactive_tree, pw);
|
||||||
free(pw);
|
free(pw);
|
||||||
}
|
}
|
||||||
|
@ -446,7 +446,7 @@ DECLARE_QOBJ_TYPE(l2vpn)
|
|||||||
#define L2VPN_TYPE_VPLS 2
|
#define L2VPN_TYPE_VPLS 2
|
||||||
|
|
||||||
/* ldp_conf */
|
/* ldp_conf */
|
||||||
enum ldpd_process {
|
extern enum ldpd_process {
|
||||||
PROC_MAIN,
|
PROC_MAIN,
|
||||||
PROC_LDP_ENGINE,
|
PROC_LDP_ENGINE,
|
||||||
PROC_LDE_ENGINE
|
PROC_LDE_ENGINE
|
||||||
|
@ -54,9 +54,6 @@ static struct imsgev *iev_lde;
|
|||||||
static struct thread *pfkey_ev;
|
static struct thread *pfkey_ev;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Master of threads. */
|
|
||||||
struct thread_master *master;
|
|
||||||
|
|
||||||
/* ldpe privileges */
|
/* ldpe privileges */
|
||||||
static zebra_capabilities_t _caps_p [] =
|
static zebra_capabilities_t _caps_p [] =
|
||||||
{
|
{
|
||||||
@ -97,6 +94,8 @@ static struct quagga_signal_t ldpe_signals[] =
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
char *pkt_ptr; /* packet buffer */
|
||||||
|
|
||||||
/* label distribution protocol engine */
|
/* label distribution protocol engine */
|
||||||
void
|
void
|
||||||
ldpe(void)
|
ldpe(void)
|
||||||
|
@ -291,7 +291,7 @@ struct tcp_conn *tcp_new(int, struct nbr *);
|
|||||||
void pending_conn_del(struct pending_conn *);
|
void pending_conn_del(struct pending_conn *);
|
||||||
struct pending_conn *pending_conn_find(int, union ldpd_addr *);
|
struct pending_conn *pending_conn_find(int, union ldpd_addr *);
|
||||||
|
|
||||||
char *pkt_ptr; /* packet buffer */
|
extern char *pkt_ptr; /* packet buffer */
|
||||||
|
|
||||||
/* pfkey.c */
|
/* pfkey.c */
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
|
@ -209,7 +209,7 @@ sock_set_nonblock(int fd)
|
|||||||
|
|
||||||
flags |= O_NONBLOCK;
|
flags |= O_NONBLOCK;
|
||||||
|
|
||||||
if ((flags = fcntl(fd, F_SETFL, flags)) == -1)
|
if (fcntl(fd, F_SETFL, flags) == -1)
|
||||||
fatal("fcntl F_SETFL");
|
fatal("fcntl F_SETFL");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ sock_set_cloexec(int fd)
|
|||||||
|
|
||||||
flags |= FD_CLOEXEC;
|
flags |= FD_CLOEXEC;
|
||||||
|
|
||||||
if ((flags = fcntl(fd, F_SETFD, flags)) == -1)
|
if (fcntl(fd, F_SETFD, flags) == -1)
|
||||||
fatal("fcntl F_SETFD");
|
fatal("fcntl F_SETFD");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ int smux_trap(struct variable *vp, size_t vp_len, const oid *ename,
|
|||||||
uint8_t sptrap)
|
uint8_t sptrap)
|
||||||
{
|
{
|
||||||
oid objid_snmptrap[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
|
oid objid_snmptrap[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
|
||||||
size_t objid_snmptrap_len = sizeof objid_snmptrap / sizeof(oid);
|
size_t objid_snmptrap_len = sizeof(objid_snmptrap) / sizeof(oid);
|
||||||
oid notification_oid[MAX_OID_LEN];
|
oid notification_oid[MAX_OID_LEN];
|
||||||
size_t notification_oid_len;
|
size_t notification_oid_len;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
14
lib/bfd.c
14
lib/bfd.c
@ -136,7 +136,7 @@ void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info,
|
|||||||
if (bfd_debug)
|
if (bfd_debug)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Suppressing BFD peer reg/dereg messages",
|
"%s: Suppressing BFD peer reg/dereg messages",
|
||||||
__FUNCTION__);
|
__func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info,
|
|||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Can't send BFD peer register, Zebra client not "
|
"%s: Can't send BFD peer register, Zebra client not "
|
||||||
"established",
|
"established",
|
||||||
__FUNCTION__);
|
__func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ static void bfd_last_update(time_t last_update, char *buf, size_t len)
|
|||||||
{
|
{
|
||||||
time_t curr;
|
time_t curr;
|
||||||
time_t diff;
|
time_t diff;
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
/* If no BFD satatus update has ever been received, print `never'. */
|
/* If no BFD satatus update has ever been received, print `never'. */
|
||||||
@ -341,10 +341,10 @@ static void bfd_last_update(time_t last_update, char *buf, size_t len)
|
|||||||
monotime(&tv);
|
monotime(&tv);
|
||||||
curr = tv.tv_sec;
|
curr = tv.tv_sec;
|
||||||
diff = curr - last_update;
|
diff = curr - last_update;
|
||||||
tm = gmtime(&diff);
|
gmtime_r(&diff, &tm);
|
||||||
|
|
||||||
snprintf(buf, len, "%d:%02d:%02d:%02d", tm->tm_yday, tm->tm_hour,
|
snprintf(buf, len, "%d:%02d:%02d:%02d", tm.tm_yday, tm.tm_hour,
|
||||||
tm->tm_min, tm->tm_sec);
|
tm.tm_min, tm.tm_sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -454,7 +454,7 @@ void bfd_client_sendmsg(struct zclient *zclient, int command,
|
|||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Can't send BFD client register, Zebra client not "
|
"%s: Can't send BFD client register, Zebra client not "
|
||||||
"established",
|
"established",
|
||||||
__FUNCTION__);
|
__func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ buffer_status_t buffer_flush_window(struct buffer *b, int fd, int width,
|
|||||||
/* Previously print out is performed. */
|
/* Previously print out is performed. */
|
||||||
if (erase_flag) {
|
if (erase_flag) {
|
||||||
iov[iov_index].iov_base = erase;
|
iov[iov_index].iov_base = erase;
|
||||||
iov[iov_index].iov_len = sizeof erase;
|
iov[iov_index].iov_len = sizeof(erase);
|
||||||
iov_index++;
|
iov_index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ buffer_status_t buffer_flush_window(struct buffer *b, int fd, int width,
|
|||||||
/* In case of `more' display need. */
|
/* In case of `more' display need. */
|
||||||
if (b->tail && (b->tail->sp < b->tail->cp) && !no_more_flag) {
|
if (b->tail && (b->tail->sp < b->tail->cp) && !no_more_flag) {
|
||||||
iov[iov_index].iov_base = more;
|
iov[iov_index].iov_base = more;
|
||||||
iov[iov_index].iov_len = sizeof more;
|
iov[iov_index].iov_len = sizeof(more);
|
||||||
iov_index++;
|
iov_index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ static int64_t filter_new_seq_get(struct access_list *access)
|
|||||||
int64_t newseq;
|
int64_t newseq;
|
||||||
struct filter *filter;
|
struct filter *filter;
|
||||||
|
|
||||||
maxseq = newseq = 0;
|
maxseq = 0;
|
||||||
|
|
||||||
for (filter = access->head; filter; filter = filter->next) {
|
for (filter = access->head; filter; filter = filter->next) {
|
||||||
if (maxseq < filter->seq)
|
if (maxseq < filter->seq)
|
||||||
|
@ -177,7 +177,7 @@ int funcname_frrzmq_thread_add_read(struct thread_master *master,
|
|||||||
else {
|
else {
|
||||||
cb = XCALLOC(MTYPE_ZEROMQ_CB, sizeof(struct frrzmq_cb));
|
cb = XCALLOC(MTYPE_ZEROMQ_CB, sizeof(struct frrzmq_cb));
|
||||||
|
|
||||||
cb->write.cancelled = 1;
|
cb->write.cancelled = true;
|
||||||
*cbp = cb;
|
*cbp = cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ int funcname_frrzmq_thread_add_read(struct thread_master *master,
|
|||||||
cb->read.cb_msg = msgfunc;
|
cb->read.cb_msg = msgfunc;
|
||||||
cb->read.cb_part = partfunc;
|
cb->read.cb_part = partfunc;
|
||||||
cb->read.cb_error = errfunc;
|
cb->read.cb_error = errfunc;
|
||||||
cb->read.cancelled = 0;
|
cb->read.cancelled = false;
|
||||||
|
|
||||||
if (events & ZMQ_POLLIN) {
|
if (events & ZMQ_POLLIN) {
|
||||||
if (cb->read.thread) {
|
if (cb->read.thread) {
|
||||||
@ -285,7 +285,7 @@ int funcname_frrzmq_thread_add_write(struct thread_master *master,
|
|||||||
else {
|
else {
|
||||||
cb = XCALLOC(MTYPE_ZEROMQ_CB, sizeof(struct frrzmq_cb));
|
cb = XCALLOC(MTYPE_ZEROMQ_CB, sizeof(struct frrzmq_cb));
|
||||||
|
|
||||||
cb->read.cancelled = 1;
|
cb->read.cancelled = true;
|
||||||
*cbp = cb;
|
*cbp = cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ int funcname_frrzmq_thread_add_write(struct thread_master *master,
|
|||||||
cb->write.cb_msg = msgfunc;
|
cb->write.cb_msg = msgfunc;
|
||||||
cb->write.cb_part = NULL;
|
cb->write.cb_part = NULL;
|
||||||
cb->write.cb_error = errfunc;
|
cb->write.cb_error = errfunc;
|
||||||
cb->write.cancelled = 0;
|
cb->write.cancelled = false;
|
||||||
|
|
||||||
if (events & ZMQ_POLLOUT) {
|
if (events & ZMQ_POLLOUT) {
|
||||||
if (cb->write.thread) {
|
if (cb->write.thread) {
|
||||||
@ -316,7 +316,7 @@ void frrzmq_thread_cancel(struct frrzmq_cb **cb, struct cb_core *core)
|
|||||||
{
|
{
|
||||||
if (!cb || !*cb)
|
if (!cb || !*cb)
|
||||||
return;
|
return;
|
||||||
core->cancelled = 1;
|
core->cancelled = true;
|
||||||
if (core->thread) {
|
if (core->thread) {
|
||||||
thread_cancel(core->thread);
|
thread_cancel(core->thread);
|
||||||
core->thread = NULL;
|
core->thread = NULL;
|
||||||
|
@ -36,11 +36,6 @@ extern "C" {
|
|||||||
#define HASHWALK_CONTINUE 0
|
#define HASHWALK_CONTINUE 0
|
||||||
#define HASHWALK_ABORT -1
|
#define HASHWALK_ABORT -1
|
||||||
|
|
||||||
#if CONFDATE > 20200225
|
|
||||||
CPP_NOTICE("hash.h: time to remove hash_backet #define")
|
|
||||||
#endif
|
|
||||||
#define hash_backet hash_bucket
|
|
||||||
|
|
||||||
struct hash_bucket {
|
struct hash_bucket {
|
||||||
/*
|
/*
|
||||||
* if this bucket is the head of the linked listed, len denotes the
|
* if this bucket is the head of the linked listed, len denotes the
|
||||||
|
@ -119,10 +119,13 @@ static inline void ipv4_mapped_ipv6_to_ipv4(struct in6_addr *in6,
|
|||||||
memcpy(in, (char *)in6 + 12, sizeof(struct in_addr));
|
memcpy(in, (char *)in6 + 12, sizeof(struct in_addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if a struct ipaddr has nonzero value
|
||||||
|
*/
|
||||||
static inline bool ipaddr_isset(struct ipaddr *ip)
|
static inline bool ipaddr_isset(struct ipaddr *ip)
|
||||||
{
|
{
|
||||||
static struct ipaddr a = {};
|
static struct ipaddr a = {};
|
||||||
return (0 == memcmp(&a, ip, sizeof(struct ipaddr)));
|
return (0 != memcmp(&a, ip, sizeof(struct ipaddr)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -967,12 +967,12 @@ static struct cmd_node keychain_key_node = {KEYCHAIN_KEY_NODE,
|
|||||||
|
|
||||||
static int keychain_strftime(char *buf, int bufsiz, time_t *time)
|
static int keychain_strftime(char *buf, int bufsiz, time_t *time)
|
||||||
{
|
{
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
tm = localtime(time);
|
localtime_r(time, &tm);
|
||||||
|
|
||||||
len = strftime(buf, bufsiz, "%T %b %d %Y", tm);
|
len = strftime(buf, bufsiz, "%T %b %d %Y", &tm);
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
@ -383,7 +383,7 @@ static int frr_opt(int opt)
|
|||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
di->daemon_mode = 1;
|
di->daemon_mode = true;
|
||||||
break;
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
oc = XMALLOC(MTYPE_TMP, sizeof(*oc));
|
oc = XMALLOC(MTYPE_TMP, sizeof(*oc));
|
||||||
@ -467,12 +467,12 @@ static int frr_opt(int opt)
|
|||||||
case 'C':
|
case 'C':
|
||||||
if (di->flags & FRR_NO_CFG_PID_DRY)
|
if (di->flags & FRR_NO_CFG_PID_DRY)
|
||||||
return 1;
|
return 1;
|
||||||
di->dryrun = 1;
|
di->dryrun = true;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
if (di->flags & FRR_NO_CFG_PID_DRY)
|
if (di->flags & FRR_NO_CFG_PID_DRY)
|
||||||
return 1;
|
return 1;
|
||||||
di->terminal = 1;
|
di->terminal = true;
|
||||||
break;
|
break;
|
||||||
case 'z':
|
case 'z':
|
||||||
di->zpathspace = true;
|
di->zpathspace = true;
|
||||||
|
@ -220,11 +220,11 @@ size_t quagga_timestamp(int timestamp_precision, char *buf, size_t buflen)
|
|||||||
|
|
||||||
/* first, we update the cache if the time has changed */
|
/* first, we update the cache if the time has changed */
|
||||||
if (cache.last != clock.tv_sec) {
|
if (cache.last != clock.tv_sec) {
|
||||||
struct tm *tm;
|
struct tm tm;
|
||||||
cache.last = clock.tv_sec;
|
cache.last = clock.tv_sec;
|
||||||
tm = localtime(&cache.last);
|
localtime_r(&cache.last, &tm);
|
||||||
cache.len = strftime(cache.buf, sizeof(cache.buf),
|
cache.len = strftime(cache.buf, sizeof(cache.buf),
|
||||||
"%Y/%m/%d %H:%M:%S", tm);
|
"%Y/%m/%d %H:%M:%S", &tm);
|
||||||
}
|
}
|
||||||
/* note: it's not worth caching the subsecond part, because
|
/* note: it's not worth caching the subsecond part, because
|
||||||
chances are that back-to-back calls are not sufficiently close
|
chances are that back-to-back calls are not sufficiently close
|
||||||
|
@ -412,8 +412,8 @@ void hmac_md5(unsigned char *text, int text_len, unsigned char *key,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* start out by storing key in pads */
|
/* start out by storing key in pads */
|
||||||
bzero(k_ipad, sizeof k_ipad);
|
bzero(k_ipad, sizeof(k_ipad));
|
||||||
bzero(k_opad, sizeof k_opad);
|
bzero(k_opad, sizeof(k_opad));
|
||||||
bcopy(key, k_ipad, key_len);
|
bcopy(key, k_ipad, key_len);
|
||||||
bcopy(key, k_opad, key_len);
|
bcopy(key, k_opad, key_len);
|
||||||
|
|
||||||
|
28
lib/mlag.c
28
lib/mlag.c
@ -81,22 +81,33 @@ char *mlag_lib_msgid_to_str(enum mlag_msg_type msg_type, char *buf, size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int mlag_lib_decode_mlag_hdr(struct stream *s, struct mlag_msg *msg)
|
int mlag_lib_decode_mlag_hdr(struct stream *s, struct mlag_msg *msg,
|
||||||
|
size_t *length)
|
||||||
{
|
{
|
||||||
if (s == NULL || msg == NULL)
|
#define LIB_MLAG_HDR_LENGTH 8
|
||||||
|
*length = stream_get_endp(s);
|
||||||
|
|
||||||
|
if (s == NULL || msg == NULL || *length < LIB_MLAG_HDR_LENGTH)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
*length -= LIB_MLAG_HDR_LENGTH;
|
||||||
|
|
||||||
STREAM_GETL(s, msg->msg_type);
|
STREAM_GETL(s, msg->msg_type);
|
||||||
STREAM_GETW(s, msg->data_len);
|
STREAM_GETW(s, msg->data_len);
|
||||||
STREAM_GETW(s, msg->msg_cnt);
|
STREAM_GETW(s, msg->msg_cnt);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
stream_failure:
|
stream_failure:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mlag_lib_decode_mroute_add(struct stream *s, struct mlag_mroute_add *msg)
|
#define MLAG_MROUTE_ADD_LENGTH \
|
||||||
|
(VRF_NAMSIZ + INTERFACE_NAMSIZ + 4 + 4 + 4 + 4 + 1 + 1 + 4)
|
||||||
|
|
||||||
|
int mlag_lib_decode_mroute_add(struct stream *s, struct mlag_mroute_add *msg,
|
||||||
|
size_t *length)
|
||||||
{
|
{
|
||||||
if (s == NULL || msg == NULL)
|
if (s == NULL || msg == NULL || *length < MLAG_MROUTE_ADD_LENGTH)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
STREAM_GET(msg->vrf_name, s, VRF_NAMSIZ);
|
STREAM_GET(msg->vrf_name, s, VRF_NAMSIZ);
|
||||||
@ -108,14 +119,18 @@ int mlag_lib_decode_mroute_add(struct stream *s, struct mlag_mroute_add *msg)
|
|||||||
STREAM_GETC(s, msg->am_i_dual_active);
|
STREAM_GETC(s, msg->am_i_dual_active);
|
||||||
STREAM_GETL(s, msg->vrf_id);
|
STREAM_GETL(s, msg->vrf_id);
|
||||||
STREAM_GET(msg->intf_name, s, INTERFACE_NAMSIZ);
|
STREAM_GET(msg->intf_name, s, INTERFACE_NAMSIZ);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
stream_failure:
|
stream_failure:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mlag_lib_decode_mroute_del(struct stream *s, struct mlag_mroute_del *msg)
|
#define MLAG_MROUTE_DEL_LENGTH (VRF_NAMSIZ + INTERFACE_NAMSIZ + 4 + 4 + 4 + 4)
|
||||||
|
|
||||||
|
int mlag_lib_decode_mroute_del(struct stream *s, struct mlag_mroute_del *msg,
|
||||||
|
size_t *length)
|
||||||
{
|
{
|
||||||
if (s == NULL || msg == NULL)
|
if (s == NULL || msg == NULL || *length < MLAG_MROUTE_DEL_LENGTH)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
STREAM_GET(msg->vrf_name, s, VRF_NAMSIZ);
|
STREAM_GET(msg->vrf_name, s, VRF_NAMSIZ);
|
||||||
@ -124,6 +139,7 @@ int mlag_lib_decode_mroute_del(struct stream *s, struct mlag_mroute_del *msg)
|
|||||||
STREAM_GETL(s, msg->owner_id);
|
STREAM_GETL(s, msg->owner_id);
|
||||||
STREAM_GETL(s, msg->vrf_id);
|
STREAM_GETL(s, msg->vrf_id);
|
||||||
STREAM_GET(msg->intf_name, s, INTERFACE_NAMSIZ);
|
STREAM_GET(msg->intf_name, s, INTERFACE_NAMSIZ);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
stream_failure:
|
stream_failure:
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -125,11 +125,14 @@ struct mlag_msg {
|
|||||||
extern char *mlag_role2str(enum mlag_role role, char *buf, size_t size);
|
extern char *mlag_role2str(enum mlag_role role, char *buf, size_t size);
|
||||||
extern char *mlag_lib_msgid_to_str(enum mlag_msg_type msg_type, char *buf,
|
extern char *mlag_lib_msgid_to_str(enum mlag_msg_type msg_type, char *buf,
|
||||||
size_t size);
|
size_t size);
|
||||||
extern int mlag_lib_decode_mlag_hdr(struct stream *s, struct mlag_msg *msg);
|
extern int mlag_lib_decode_mlag_hdr(struct stream *s, struct mlag_msg *msg,
|
||||||
|
size_t *length);
|
||||||
extern int mlag_lib_decode_mroute_add(struct stream *s,
|
extern int mlag_lib_decode_mroute_add(struct stream *s,
|
||||||
struct mlag_mroute_add *msg);
|
struct mlag_mroute_add *msg,
|
||||||
|
size_t *length);
|
||||||
extern int mlag_lib_decode_mroute_del(struct stream *s,
|
extern int mlag_lib_decode_mroute_del(struct stream *s,
|
||||||
struct mlag_mroute_del *msg);
|
struct mlag_mroute_del *msg,
|
||||||
|
size_t *length);
|
||||||
extern int mlag_lib_decode_mlag_status(struct stream *s,
|
extern int mlag_lib_decode_mlag_status(struct stream *s,
|
||||||
struct mlag_status *msg);
|
struct mlag_status *msg);
|
||||||
extern int mlag_lib_decode_vxlan_update(struct stream *s,
|
extern int mlag_lib_decode_vxlan_update(struct stream *s,
|
||||||
|
@ -58,7 +58,7 @@ static const char *execname = NULL;
|
|||||||
|
|
||||||
void frrmod_init(struct frrmod_runtime *modinfo)
|
void frrmod_init(struct frrmod_runtime *modinfo)
|
||||||
{
|
{
|
||||||
modinfo->finished_loading = 1;
|
modinfo->finished_loading = true;
|
||||||
*frrmod_last = modinfo;
|
*frrmod_last = modinfo;
|
||||||
frrmod_last = &modinfo->next;
|
frrmod_last = &modinfo->next;
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ struct frrmod_runtime *frrmod_load(const char *spec, const char *dir, char *err,
|
|||||||
goto out_fail;
|
goto out_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtinfo->finished_loading = 1;
|
rtinfo->finished_loading = true;
|
||||||
|
|
||||||
*frrmod_last = rtinfo;
|
*frrmod_last = rtinfo;
|
||||||
frrmod_last = &rtinfo->next;
|
frrmod_last = &rtinfo->next;
|
||||||
|
@ -216,7 +216,8 @@ struct nexthop_group *nexthop_group_new(void)
|
|||||||
return XCALLOC(MTYPE_NEXTHOP_GROUP, sizeof(struct nexthop_group));
|
return XCALLOC(MTYPE_NEXTHOP_GROUP, sizeof(struct nexthop_group));
|
||||||
}
|
}
|
||||||
|
|
||||||
void nexthop_group_copy(struct nexthop_group *to, struct nexthop_group *from)
|
void nexthop_group_copy(struct nexthop_group *to,
|
||||||
|
const struct nexthop_group *from)
|
||||||
{
|
{
|
||||||
/* Copy everything, including recursive info */
|
/* Copy everything, including recursive info */
|
||||||
copy_nexthops(&to->nexthop, from->nexthop, NULL);
|
copy_nexthops(&to->nexthop, from->nexthop, NULL);
|
||||||
|
@ -43,7 +43,7 @@ struct nexthop_group *nexthop_group_new(void);
|
|||||||
void nexthop_group_delete(struct nexthop_group **nhg);
|
void nexthop_group_delete(struct nexthop_group **nhg);
|
||||||
|
|
||||||
void nexthop_group_copy(struct nexthop_group *to,
|
void nexthop_group_copy(struct nexthop_group *to,
|
||||||
struct nexthop_group *from);
|
const struct nexthop_group *from);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy a list of nexthops in 'nh' to an nhg, enforcing canonical sort order
|
* Copy a list of nexthops in 'nh' to an nhg, enforcing canonical sort order
|
||||||
|
@ -996,7 +996,7 @@ static int nb_transaction_process(enum nb_event event,
|
|||||||
* Only try to release resources that were allocated
|
* Only try to release resources that were allocated
|
||||||
* successfully.
|
* successfully.
|
||||||
*/
|
*/
|
||||||
if (event == NB_EV_ABORT && change->prepare_ok == false)
|
if (event == NB_EV_ABORT && !change->prepare_ok)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Call the appropriate callback. */
|
/* Call the appropriate callback. */
|
||||||
|
@ -387,7 +387,7 @@ static int64_t prefix_new_seq_get(struct prefix_list *plist)
|
|||||||
int64_t newseq;
|
int64_t newseq;
|
||||||
struct prefix_list_entry *pentry;
|
struct prefix_list_entry *pentry;
|
||||||
|
|
||||||
maxseq = newseq = 0;
|
maxseq = 0;
|
||||||
|
|
||||||
for (pentry = plist->head; pentry; pentry = pentry->next) {
|
for (pentry = plist->head; pentry; pentry = pentry->next) {
|
||||||
if (maxseq < pentry->seq)
|
if (maxseq < pentry->seq)
|
||||||
@ -2039,7 +2039,7 @@ static void prefix_list_reset_afi(afi_t afi, int orf)
|
|||||||
assert(master->str.head == NULL);
|
assert(master->str.head == NULL);
|
||||||
assert(master->str.tail == NULL);
|
assert(master->str.tail == NULL);
|
||||||
|
|
||||||
master->seqnum = 1;
|
master->seqnum = true;
|
||||||
master->recent = NULL;
|
master->recent = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1082,7 +1082,7 @@ struct prefix *prefix_new(void)
|
|||||||
{
|
{
|
||||||
struct prefix *p;
|
struct prefix *p;
|
||||||
|
|
||||||
p = XCALLOC(MTYPE_PREFIX, sizeof *p);
|
p = XCALLOC(MTYPE_PREFIX, sizeof(*p));
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -686,7 +686,7 @@ build_arg_table(struct typetable *types, va_list ap, union arg **argtable)
|
|||||||
|
|
||||||
if (types->tablemax >= STATIC_ARG_TBL_SIZE) {
|
if (types->tablemax >= STATIC_ARG_TBL_SIZE) {
|
||||||
*argtable = (union arg *)
|
*argtable = (union arg *)
|
||||||
malloc (sizeof (union arg) * (types->tablemax + 1));
|
malloc (sizeof(union arg) * (types->tablemax + 1));
|
||||||
if (*argtable == NULL)
|
if (*argtable == NULL)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key,
|
|||||||
csv_record_t *mh_rec, *rec;
|
csv_record_t *mh_rec, *rec;
|
||||||
|
|
||||||
if (!p_ctxt) {
|
if (!p_ctxt) {
|
||||||
ERRLOG("%s: no context \n", __FUNCTION__);
|
ERRLOG("%s: no context \n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key,
|
|||||||
/* append to the hdr record */
|
/* append to the hdr record */
|
||||||
rec = csv_append_record(csv, rec, 1, key);
|
rec = csv_append_record(csv, rec, 1, key);
|
||||||
if (!rec) {
|
if (!rec) {
|
||||||
ERRLOG("%s: Could not append key \n", __FUNCTION__);
|
ERRLOG("%s: Could not append key \n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key,
|
|||||||
/* append to the data record */
|
/* append to the data record */
|
||||||
rec = csv_append_record(csv, rec, 1, val);
|
rec = csv_append_record(csv, rec, 1, val);
|
||||||
if (!rec) {
|
if (!rec) {
|
||||||
ERRLOG("%s: Could not append val \n", __FUNCTION__);
|
ERRLOG("%s: Could not append val \n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt,
|
|||||||
csv = csv_init(NULL, NULL, PTMLIB_MSG_SZ);
|
csv = csv_init(NULL, NULL, PTMLIB_MSG_SZ);
|
||||||
|
|
||||||
if (!csv) {
|
if (!csv) {
|
||||||
ERRLOG("%s: Could not allocate csv \n", __FUNCTION__);
|
ERRLOG("%s: Could not allocate csv \n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt,
|
|||||||
cmd_id, hdl->client_name);
|
cmd_id, hdl->client_name);
|
||||||
|
|
||||||
if (!rec) {
|
if (!rec) {
|
||||||
ERRLOG("%s: Could not allocate record \n", __FUNCTION__);
|
ERRLOG("%s: Could not allocate record \n", __func__);
|
||||||
csv_clean(csv);
|
csv_clean(csv);
|
||||||
csv_free(csv);
|
csv_free(csv);
|
||||||
return -1;
|
return -1;
|
||||||
@ -202,7 +202,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt,
|
|||||||
|
|
||||||
p_ctxt = calloc(1, sizeof(*p_ctxt));
|
p_ctxt = calloc(1, sizeof(*p_ctxt));
|
||||||
if (!p_ctxt) {
|
if (!p_ctxt) {
|
||||||
ERRLOG("%s: Could not allocate context \n", __FUNCTION__);
|
ERRLOG("%s: Could not allocate context \n", __func__);
|
||||||
csv_clean(csv);
|
csv_clean(csv);
|
||||||
csv_free(csv);
|
csv_free(csv);
|
||||||
return -1;
|
return -1;
|
||||||
@ -234,7 +234,7 @@ int ptm_lib_cleanup_msg(ptm_lib_handle_t *hdl, void *ctxt)
|
|||||||
csv_t *csv;
|
csv_t *csv;
|
||||||
|
|
||||||
if (!p_ctxt) {
|
if (!p_ctxt) {
|
||||||
ERRLOG("%s: no context \n", __FUNCTION__);
|
ERRLOG("%s: no context \n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ int ptm_lib_complete_msg(ptm_lib_handle_t *hdl, void *ctxt, char *buf, int *len)
|
|||||||
csv_record_t *rec;
|
csv_record_t *rec;
|
||||||
|
|
||||||
if (!p_ctxt) {
|
if (!p_ctxt) {
|
||||||
ERRLOG("%s: no context \n", __FUNCTION__);
|
ERRLOG("%s: no context \n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ int ptm_lib_complete_msg(ptm_lib_handle_t *hdl, void *ctxt, char *buf, int *len)
|
|||||||
/* parse csv contents into string */
|
/* parse csv contents into string */
|
||||||
if (buf && len) {
|
if (buf && len) {
|
||||||
if (csv_serialize(csv, buf, *len)) {
|
if (csv_serialize(csv, buf, *len)) {
|
||||||
ERRLOG("%s: cannot serialize\n", __FUNCTION__);
|
ERRLOG("%s: cannot serialize\n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
*len = csvlen(csv);
|
*len = csvlen(csv);
|
||||||
@ -425,8 +425,7 @@ int ptm_lib_process_msg(ptm_lib_handle_t *hdl, int fd, char *inbuf, int inlen,
|
|||||||
csv_decode(csv, inbuf);
|
csv_decode(csv, inbuf);
|
||||||
p_ctxt = calloc(1, sizeof(*p_ctxt));
|
p_ctxt = calloc(1, sizeof(*p_ctxt));
|
||||||
if (!p_ctxt) {
|
if (!p_ctxt) {
|
||||||
ERRLOG("%s: Could not allocate context \n",
|
ERRLOG("%s: Could not allocate context \n", __func__);
|
||||||
__FUNCTION__);
|
|
||||||
csv_clean(csv);
|
csv_clean(csv);
|
||||||
csv_free(csv);
|
csv_free(csv);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2257,7 +2257,7 @@ static void route_map_pentry_update(route_map_event_t event,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void route_map_pentry_process_dependency(struct hash_backet *backet,
|
static void route_map_pentry_process_dependency(struct hash_bucket *backet,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
char *rmap_name = NULL;
|
char *rmap_name = NULL;
|
||||||
@ -2447,7 +2447,7 @@ route_map_result_t route_map_apply(struct route_map *map,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (; index; index = index->next) {
|
for (; index; index = index->next) {
|
||||||
if (skip_match_clause == false) {
|
if (!skip_match_clause) {
|
||||||
/* Apply this index. */
|
/* Apply this index. */
|
||||||
match_ret = route_map_apply_match(&index->match_list,
|
match_ret = route_map_apply_match(&index->match_list,
|
||||||
prefix, type, object);
|
prefix, type, object);
|
||||||
@ -2684,8 +2684,7 @@ static void route_map_print_dependency(struct hash_bucket *bucket, void *data)
|
|||||||
char *rmap_name = dep_data->rname;
|
char *rmap_name = dep_data->rname;
|
||||||
char *dep_name = data;
|
char *dep_name = data;
|
||||||
|
|
||||||
zlog_debug("%s: Dependency for %s: %s", __FUNCTION__, dep_name,
|
zlog_debug("%s: Dependency for %s: %s", __func__, dep_name, rmap_name);
|
||||||
rmap_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int route_map_dep_update(struct hash *dephash, const char *dep_name,
|
static int route_map_dep_update(struct hash *dephash, const char *dep_name,
|
||||||
|
@ -221,8 +221,7 @@ static int lib_route_map_entry_description_modify(enum nb_event event,
|
|||||||
break;
|
break;
|
||||||
case NB_EV_APPLY:
|
case NB_EV_APPLY:
|
||||||
rmi = nb_running_get_entry(dnode, NULL, true);
|
rmi = nb_running_get_entry(dnode, NULL, true);
|
||||||
if (rmi->description != NULL)
|
XFREE(MTYPE_TMP, rmi->description);
|
||||||
XFREE(MTYPE_TMP, rmi->description);
|
|
||||||
rmi->description = resource->ptr;
|
rmi->description = resource->ptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ bool seqlock_check(struct seqlock *sqlo, seqlock_val_t val)
|
|||||||
|
|
||||||
cur = atomic_load_explicit(&sqlo->pos, memory_order_relaxed);
|
cur = atomic_load_explicit(&sqlo->pos, memory_order_relaxed);
|
||||||
if (!(cur & SEQLOCK_HELD))
|
if (!(cur & SEQLOCK_HELD))
|
||||||
return 1;
|
return true;
|
||||||
cur = SEQLOCK_VAL(cur) - val - 1;
|
cur = SEQLOCK_VAL(cur) - val - 1;
|
||||||
assert(cur < 0x40000000 || cur > 0xc0000000);
|
assert(cur < 0x40000000 || cur > 0xc0000000);
|
||||||
return cur < 0x80000000;
|
return cur < 0x80000000;
|
||||||
|
@ -378,7 +378,7 @@ int skiplist_next_value(register struct skiplist *l, /* in */
|
|||||||
void **valuePointer, /* in/out */
|
void **valuePointer, /* in/out */
|
||||||
void **cursor) /* in/out */
|
void **cursor) /* in/out */
|
||||||
{
|
{
|
||||||
register int k, m;
|
register int k;
|
||||||
register struct skiplistnode *p, *q;
|
register struct skiplistnode *p, *q;
|
||||||
|
|
||||||
CHECKLAST(l);
|
CHECKLAST(l);
|
||||||
@ -389,7 +389,7 @@ int skiplist_next_value(register struct skiplist *l, /* in */
|
|||||||
|
|
||||||
if (!cursor || !*cursor) {
|
if (!cursor || !*cursor) {
|
||||||
p = l->header;
|
p = l->header;
|
||||||
k = m = l->level;
|
k = l->level;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find matching key
|
* Find matching key
|
||||||
|
@ -90,12 +90,11 @@ int getsockopt_so_recvbuf(const int sock)
|
|||||||
static void *getsockopt_cmsg_data(struct msghdr *msgh, int level, int type)
|
static void *getsockopt_cmsg_data(struct msghdr *msgh, int level, int type)
|
||||||
{
|
{
|
||||||
struct cmsghdr *cmsg;
|
struct cmsghdr *cmsg;
|
||||||
void *ptr = NULL;
|
|
||||||
|
|
||||||
for (cmsg = CMSG_FIRSTHDR(msgh); cmsg != NULL;
|
for (cmsg = CMSG_FIRSTHDR(msgh); cmsg != NULL;
|
||||||
cmsg = CMSG_NXTHDR(msgh, cmsg))
|
cmsg = CMSG_NXTHDR(msgh, cmsg))
|
||||||
if (cmsg->cmsg_level == level && cmsg->cmsg_type == type)
|
if (cmsg->cmsg_level == level && cmsg->cmsg_type == type)
|
||||||
return (ptr = CMSG_DATA(cmsg));
|
return CMSG_DATA(cmsg);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -684,7 +683,7 @@ int sockopt_tcp_signature_ext(int sock, union sockunion *su, uint16_t prefixlen,
|
|||||||
#endif /* GNU_LINUX */
|
#endif /* GNU_LINUX */
|
||||||
|
|
||||||
if ((ret = setsockopt(sock, IPPROTO_TCP, optname, &md5sig,
|
if ((ret = setsockopt(sock, IPPROTO_TCP, optname, &md5sig,
|
||||||
sizeof md5sig))
|
sizeof(md5sig)))
|
||||||
< 0) {
|
< 0) {
|
||||||
/* ENOENT is harmless. It is returned when we clear a password
|
/* ENOENT is harmless. It is returned when we clear a password
|
||||||
for which
|
for which
|
||||||
|
@ -39,7 +39,7 @@ extern int setsockopt_ipv6_hoplimit(int, int);
|
|||||||
extern int setsockopt_ipv6_multicast_loop(int, int);
|
extern int setsockopt_ipv6_multicast_loop(int, int);
|
||||||
extern int setsockopt_ipv6_tclass(int, int);
|
extern int setsockopt_ipv6_tclass(int, int);
|
||||||
|
|
||||||
#define SOPT_SIZE_CMSG_PKTINFO_IPV6() (sizeof (struct in6_pktinfo));
|
#define SOPT_SIZE_CMSG_PKTINFO_IPV6() (sizeof(struct in6_pktinfo));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Size defines for control messages used to get ifindex. We define
|
* Size defines for control messages used to get ifindex. We define
|
||||||
@ -49,7 +49,7 @@ extern int setsockopt_ipv6_tclass(int, int);
|
|||||||
*/
|
*/
|
||||||
#if defined(IP_PKTINFO)
|
#if defined(IP_PKTINFO)
|
||||||
/* Linux in_pktinfo. */
|
/* Linux in_pktinfo. */
|
||||||
#define SOPT_SIZE_CMSG_PKTINFO_IPV4() (CMSG_SPACE(sizeof (struct in_pktinfo)))
|
#define SOPT_SIZE_CMSG_PKTINFO_IPV4() (CMSG_SPACE(sizeof(struct in_pktinfo)))
|
||||||
/* XXX This should perhaps be defined even if IP_PKTINFO is not. */
|
/* XXX This should perhaps be defined even if IP_PKTINFO is not. */
|
||||||
#define SOPT_SIZE_CMSG_PKTINFO(af) \
|
#define SOPT_SIZE_CMSG_PKTINFO(af) \
|
||||||
((af == AF_INET) ? SOPT_SIZE_CMSG_PKTINFO_IPV4() \
|
((af == AF_INET) ? SOPT_SIZE_CMSG_PKTINFO_IPV4() \
|
||||||
@ -60,9 +60,9 @@ extern int setsockopt_ipv6_tclass(int, int);
|
|||||||
/* BSD/Solaris */
|
/* BSD/Solaris */
|
||||||
|
|
||||||
#if defined(SUNOS_5)
|
#if defined(SUNOS_5)
|
||||||
#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof (uint_t))
|
#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof(uint_t))
|
||||||
#else
|
#else
|
||||||
#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof (struct sockaddr_dl))
|
#define SOPT_SIZE_CMSG_RECVIF_IPV4() (sizeof(struct sockaddr_dl))
|
||||||
#endif /* SUNOS_5 */
|
#endif /* SUNOS_5 */
|
||||||
#endif /* IP_RECVIF */
|
#endif /* IP_RECVIF */
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ extern int setsockopt_ipv6_tclass(int, int);
|
|||||||
#elif defined(SOPT_SIZE_CMSG_RECVIF_IPV4)
|
#elif defined(SOPT_SIZE_CMSG_RECVIF_IPV4)
|
||||||
#define SOPT_SIZE_CMSG_IFINDEX_IPV4() SOPT_SIZE_CMSG_RECVIF_IPV4()
|
#define SOPT_SIZE_CMSG_IFINDEX_IPV4() SOPT_SIZE_CMSG_RECVIF_IPV4()
|
||||||
#else /* Nothing available */
|
#else /* Nothing available */
|
||||||
#define SOPT_SIZE_CMSG_IFINDEX_IPV4() (sizeof (char *))
|
#define SOPT_SIZE_CMSG_IFINDEX_IPV4() (sizeof(char *))
|
||||||
#endif /* SOPT_SIZE_CMSG_IFINDEX_IPV4 */
|
#endif /* SOPT_SIZE_CMSG_IFINDEX_IPV4 */
|
||||||
|
|
||||||
#define SOPT_SIZE_CMSG_IFINDEX(af) \
|
#define SOPT_SIZE_CMSG_IFINDEX(af) \
|
||||||
|
@ -214,7 +214,7 @@ enum connect_result sockunion_connect(int fd, const union sockunion *peersu,
|
|||||||
if (errno != EINPROGRESS) {
|
if (errno != EINPROGRESS) {
|
||||||
char str[SU_ADDRSTRLEN];
|
char str[SU_ADDRSTRLEN];
|
||||||
zlog_info("can't connect to %s fd %d : %s",
|
zlog_info("can't connect to %s fd %d : %s",
|
||||||
sockunion_log(&su, str, sizeof str), fd,
|
sockunion_log(&su, str, sizeof(str)), fd,
|
||||||
safe_strerror(errno));
|
safe_strerror(errno));
|
||||||
return connect_error;
|
return connect_error;
|
||||||
}
|
}
|
||||||
@ -518,8 +518,8 @@ union sockunion *sockunion_getsockname(int fd)
|
|||||||
} name;
|
} name;
|
||||||
union sockunion *su;
|
union sockunion *su;
|
||||||
|
|
||||||
memset(&name, 0, sizeof name);
|
memset(&name, 0, sizeof(name));
|
||||||
len = sizeof name;
|
len = sizeof(name);
|
||||||
|
|
||||||
ret = getsockname(fd, (struct sockaddr *)&name, &len);
|
ret = getsockname(fd, (struct sockaddr *)&name, &len);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
@ -556,8 +556,8 @@ union sockunion *sockunion_getpeername(int fd)
|
|||||||
} name;
|
} name;
|
||||||
union sockunion *su;
|
union sockunion *su;
|
||||||
|
|
||||||
memset(&name, 0, sizeof name);
|
memset(&name, 0, sizeof(name));
|
||||||
len = sizeof name;
|
len = sizeof(name);
|
||||||
ret = getpeername(fd, (struct sockaddr *)&name, &len);
|
ret = getpeername(fd, (struct sockaddr *)&name, &len);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
flog_err(EC_LIB_SOCKET, "Can't get remote address and port: %s",
|
flog_err(EC_LIB_SOCKET, "Can't get remote address and port: %s",
|
||||||
|
@ -171,7 +171,7 @@ static void cpu_record_print(struct vty *vty, uint8_t filter)
|
|||||||
struct thread_master *m;
|
struct thread_master *m;
|
||||||
struct listnode *ln;
|
struct listnode *ln;
|
||||||
|
|
||||||
memset(&tmp, 0, sizeof tmp);
|
memset(&tmp, 0, sizeof(tmp));
|
||||||
tmp.funcname = "TOTAL";
|
tmp.funcname = "TOTAL";
|
||||||
tmp.types = filter;
|
tmp.types = filter;
|
||||||
|
|
||||||
|
@ -493,8 +493,7 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
|
|||||||
/* initialise NS, in case VRF backend if NETNS */
|
/* initialise NS, in case VRF backend if NETNS */
|
||||||
ns_init();
|
ns_init();
|
||||||
if (debug_vrf)
|
if (debug_vrf)
|
||||||
zlog_debug("%s: Initializing VRF subsystem",
|
zlog_debug("%s: Initializing VRF subsystem", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
|
|
||||||
vrf_master.vrf_new_hook = create;
|
vrf_master.vrf_new_hook = create;
|
||||||
vrf_master.vrf_enable_hook = enable;
|
vrf_master.vrf_enable_hook = enable;
|
||||||
@ -535,8 +534,7 @@ void vrf_terminate(void)
|
|||||||
struct vrf *vrf;
|
struct vrf *vrf;
|
||||||
|
|
||||||
if (debug_vrf)
|
if (debug_vrf)
|
||||||
zlog_debug("%s: Shutting down vrf subsystem",
|
zlog_debug("%s: Shutting down vrf subsystem", __func__);
|
||||||
__PRETTY_FUNCTION__);
|
|
||||||
|
|
||||||
while (!RB_EMPTY(vrf_id_head, &vrfs_by_id)) {
|
while (!RB_EMPTY(vrf_id_head, &vrfs_by_id)) {
|
||||||
vrf = RB_ROOT(vrf_id_head, &vrfs_by_id);
|
vrf = RB_ROOT(vrf_id_head, &vrfs_by_id);
|
||||||
|
12
lib/wheel.c
12
lib/wheel.c
@ -47,8 +47,8 @@ static int wheel_timer_thread_helper(struct thread *t)
|
|||||||
curr_slot = wheel->curr_slot % wheel->slots;
|
curr_slot = wheel->curr_slot % wheel->slots;
|
||||||
|
|
||||||
if (debug_timer_wheel)
|
if (debug_timer_wheel)
|
||||||
zlog_debug("%s: Wheel Slot: %lld(%lld) count: %d",
|
zlog_debug("%s: Wheel Slot: %lld(%lld) count: %d", __func__,
|
||||||
__PRETTY_FUNCTION__, wheel->curr_slot, curr_slot,
|
wheel->curr_slot, curr_slot,
|
||||||
listcount(wheel->wheel_slot_lists[curr_slot]));
|
listcount(wheel->wheel_slot_lists[curr_slot]));
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS(wheel->wheel_slot_lists[curr_slot], node,
|
for (ALL_LIST_ELEMENTS(wheel->wheel_slot_lists[curr_slot], node,
|
||||||
@ -146,8 +146,8 @@ int wheel_add_item(struct timer_wheel *wheel, void *item)
|
|||||||
slot = (*wheel->slot_key)(item);
|
slot = (*wheel->slot_key)(item);
|
||||||
|
|
||||||
if (debug_timer_wheel)
|
if (debug_timer_wheel)
|
||||||
zlog_debug("%s: Inserting %p: %lld %lld", __PRETTY_FUNCTION__,
|
zlog_debug("%s: Inserting %p: %lld %lld", __func__, item, slot,
|
||||||
item, slot, slot % wheel->slots);
|
slot % wheel->slots);
|
||||||
listnode_add(wheel->wheel_slot_lists[slot % wheel->slots], item);
|
listnode_add(wheel->wheel_slot_lists[slot % wheel->slots], item);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -160,8 +160,8 @@ int wheel_remove_item(struct timer_wheel *wheel, void *item)
|
|||||||
slot = (*wheel->slot_key)(item);
|
slot = (*wheel->slot_key)(item);
|
||||||
|
|
||||||
if (debug_timer_wheel)
|
if (debug_timer_wheel)
|
||||||
zlog_debug("%s: Removing %p: %lld %lld", __PRETTY_FUNCTION__,
|
zlog_debug("%s: Removing %p: %lld %lld", __func__, item, slot,
|
||||||
item, slot, slot % wheel->slots);
|
slot % wheel->slots);
|
||||||
listnode_delete(wheel->wheel_slot_lists[slot % wheel->slots], item);
|
listnode_delete(wheel->wheel_slot_lists[slot % wheel->slots], item);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -236,9 +236,8 @@ int zclient_socket_connect(struct zclient *zclient)
|
|||||||
ret = connect(sock, (struct sockaddr *)&zclient_addr, zclient_addr_len);
|
ret = connect(sock, (struct sockaddr *)&zclient_addr, zclient_addr_len);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (zclient_debug)
|
if (zclient_debug)
|
||||||
zlog_debug("%s connect failure: %d(%s)",
|
zlog_debug("%s connect failure: %d(%s)", __func__,
|
||||||
__PRETTY_FUNCTION__, errno,
|
errno, safe_strerror(errno));
|
||||||
safe_strerror(errno));
|
|
||||||
close(sock);
|
close(sock);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -958,7 +957,7 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api)
|
|||||||
if (api->type >= ZEBRA_ROUTE_MAX) {
|
if (api->type >= ZEBRA_ROUTE_MAX) {
|
||||||
flog_err(EC_LIB_ZAPI_ENCODE,
|
flog_err(EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: Specified route type (%u) is not a legal value\n",
|
"%s: Specified route type (%u) is not a legal value\n",
|
||||||
__PRETTY_FUNCTION__, api->type);
|
__func__, api->type);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
stream_putc(s, api->type);
|
stream_putc(s, api->type);
|
||||||
@ -970,7 +969,7 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api)
|
|||||||
if (api->safi < SAFI_UNICAST || api->safi >= SAFI_MAX) {
|
if (api->safi < SAFI_UNICAST || api->safi >= SAFI_MAX) {
|
||||||
flog_err(EC_LIB_ZAPI_ENCODE,
|
flog_err(EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: Specified route SAFI (%u) is not a legal value\n",
|
"%s: Specified route SAFI (%u) is not a legal value\n",
|
||||||
__PRETTY_FUNCTION__, api->safi);
|
__func__, api->safi);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
stream_putc(s, api->safi);
|
stream_putc(s, api->safi);
|
||||||
@ -1122,7 +1121,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
|
|||||||
if (api->type >= ZEBRA_ROUTE_MAX) {
|
if (api->type >= ZEBRA_ROUTE_MAX) {
|
||||||
flog_err(EC_LIB_ZAPI_ENCODE,
|
flog_err(EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: Specified route type: %d is not a legal value\n",
|
"%s: Specified route type: %d is not a legal value\n",
|
||||||
__PRETTY_FUNCTION__, api->type);
|
__func__, api->type);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1133,7 +1132,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
|
|||||||
if (api->safi < SAFI_UNICAST || api->safi >= SAFI_MAX) {
|
if (api->safi < SAFI_UNICAST || api->safi >= SAFI_MAX) {
|
||||||
flog_err(EC_LIB_ZAPI_ENCODE,
|
flog_err(EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: Specified route SAFI (%u) is not a legal value\n",
|
"%s: Specified route SAFI (%u) is not a legal value\n",
|
||||||
__PRETTY_FUNCTION__, api->safi);
|
__func__, api->safi);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1146,7 +1145,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
|
|||||||
flog_err(
|
flog_err(
|
||||||
EC_LIB_ZAPI_ENCODE,
|
EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: V4 prefixlen is %d which should not be more than 32",
|
"%s: V4 prefixlen is %d which should not be more than 32",
|
||||||
__PRETTY_FUNCTION__, api->prefix.prefixlen);
|
__func__, api->prefix.prefixlen);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1155,14 +1154,14 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
|
|||||||
flog_err(
|
flog_err(
|
||||||
EC_LIB_ZAPI_ENCODE,
|
EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: v6 prefixlen is %d which should not be more than 128",
|
"%s: v6 prefixlen is %d which should not be more than 128",
|
||||||
__PRETTY_FUNCTION__, api->prefix.prefixlen);
|
__func__, api->prefix.prefixlen);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
flog_err(EC_LIB_ZAPI_ENCODE,
|
flog_err(EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: Specified family %d is not v4 or v6",
|
"%s: Specified family %d is not v4 or v6", __func__,
|
||||||
__PRETTY_FUNCTION__, api->prefix.family);
|
api->prefix.family);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
STREAM_GET(&api->prefix.u.prefix, s, PSIZE(api->prefix.prefixlen));
|
STREAM_GET(&api->prefix.u.prefix, s, PSIZE(api->prefix.prefixlen));
|
||||||
@ -1174,7 +1173,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
|
|||||||
flog_err(
|
flog_err(
|
||||||
EC_LIB_ZAPI_ENCODE,
|
EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: SRC Prefix prefixlen received: %d is too large",
|
"%s: SRC Prefix prefixlen received: %d is too large",
|
||||||
__PRETTY_FUNCTION__, api->src_prefix.prefixlen);
|
__func__, api->src_prefix.prefixlen);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
STREAM_GET(&api->src_prefix.prefix, s,
|
STREAM_GET(&api->src_prefix.prefix, s,
|
||||||
@ -1185,7 +1184,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
|
|||||||
flog_err(
|
flog_err(
|
||||||
EC_LIB_ZAPI_ENCODE,
|
EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: SRC prefix specified in some manner that makes no sense",
|
"%s: SRC prefix specified in some manner that makes no sense",
|
||||||
__PRETTY_FUNCTION__);
|
__func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1309,8 +1308,7 @@ bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno,
|
|||||||
STREAM_GETL(s, ifi);
|
STREAM_GETL(s, ifi);
|
||||||
|
|
||||||
if (zclient_debug)
|
if (zclient_debug)
|
||||||
zlog_debug("%s: %u %u %u %u", __PRETTY_FUNCTION__, seq, prio,
|
zlog_debug("%s: %u %u %u %u", __func__, seq, prio, uni, ifi);
|
||||||
uni, ifi);
|
|
||||||
*seqno = seq;
|
*seqno = seq;
|
||||||
*priority = prio;
|
*priority = prio;
|
||||||
*unique = uni;
|
*unique = uni;
|
||||||
@ -1332,7 +1330,7 @@ bool zapi_ipset_notify_decode(struct stream *s, uint32_t *unique,
|
|||||||
STREAM_GETL(s, uni);
|
STREAM_GETL(s, uni);
|
||||||
|
|
||||||
if (zclient_debug)
|
if (zclient_debug)
|
||||||
zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni);
|
zlog_debug("%s: %u", __func__, uni);
|
||||||
*unique = uni;
|
*unique = uni;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1354,7 +1352,7 @@ bool zapi_ipset_entry_notify_decode(struct stream *s, uint32_t *unique,
|
|||||||
STREAM_GET(ipset_name, s, ZEBRA_IPSET_NAME_SIZE);
|
STREAM_GET(ipset_name, s, ZEBRA_IPSET_NAME_SIZE);
|
||||||
|
|
||||||
if (zclient_debug)
|
if (zclient_debug)
|
||||||
zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni);
|
zlog_debug("%s: %u", __func__, uni);
|
||||||
*unique = uni;
|
*unique = uni;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1374,7 +1372,7 @@ bool zapi_iptable_notify_decode(struct stream *s,
|
|||||||
STREAM_GETL(s, uni);
|
STREAM_GETL(s, uni);
|
||||||
|
|
||||||
if (zclient_debug)
|
if (zclient_debug)
|
||||||
zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni);
|
zlog_debug("%s: %u", __func__, uni);
|
||||||
*unique = uni;
|
*unique = uni;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1978,7 +1976,7 @@ struct connected *zebra_interface_address_read(int type, struct stream *s,
|
|||||||
"warning: interface %s address %s with peer flag set, but no peer address!",
|
"warning: interface %s address %s with peer flag set, but no peer address!",
|
||||||
ifp->name,
|
ifp->name,
|
||||||
prefix2str(ifc->address, buf,
|
prefix2str(ifc->address, buf,
|
||||||
sizeof buf));
|
sizeof(buf)));
|
||||||
UNSET_FLAG(ifc->flags, ZEBRA_IFA_PEER);
|
UNSET_FLAG(ifc->flags, ZEBRA_IFA_PEER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2664,8 +2662,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl)
|
|||||||
if (zl->route.prefix.prefixlen > IPV4_MAX_BITLEN) {
|
if (zl->route.prefix.prefixlen > IPV4_MAX_BITLEN) {
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Specified prefix length %d is greater than a v4 address can support",
|
"%s: Specified prefix length %d is greater than a v4 address can support",
|
||||||
__PRETTY_FUNCTION__,
|
__func__, zl->route.prefix.prefixlen);
|
||||||
zl->route.prefix.prefixlen);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
STREAM_GET(&zl->route.prefix.u.prefix4.s_addr, s,
|
STREAM_GET(&zl->route.prefix.u.prefix4.s_addr, s,
|
||||||
@ -2675,8 +2672,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl)
|
|||||||
if (zl->route.prefix.prefixlen > IPV6_MAX_BITLEN) {
|
if (zl->route.prefix.prefixlen > IPV6_MAX_BITLEN) {
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Specified prefix length %d is greater than a v6 address can support",
|
"%s: Specified prefix length %d is greater than a v6 address can support",
|
||||||
__PRETTY_FUNCTION__,
|
__func__, zl->route.prefix.prefixlen);
|
||||||
zl->route.prefix.prefixlen);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
STREAM_GET(&zl->route.prefix.u.prefix6, s, psize);
|
STREAM_GET(&zl->route.prefix.u.prefix6, s, psize);
|
||||||
@ -2684,7 +2680,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl)
|
|||||||
default:
|
default:
|
||||||
flog_err(EC_LIB_ZAPI_ENCODE,
|
flog_err(EC_LIB_ZAPI_ENCODE,
|
||||||
"%s: Specified family %u is not v4 or v6",
|
"%s: Specified family %u is not v4 or v6",
|
||||||
__PRETTY_FUNCTION__, zl->route.prefix.family);
|
__func__, zl->route.prefix.family);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ static void nhrp_cache_authorize_binding(struct nhrp_reqid *r, void *arg)
|
|||||||
char buf[3][SU_ADDRSTRLEN];
|
char buf[3][SU_ADDRSTRLEN];
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_COMMON, "cache: %s %s: %s", c->ifp->name,
|
debugf(NHRP_DEBUG_COMMON, "cache: %s %s: %s", c->ifp->name,
|
||||||
sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]),
|
sockunion2str(&c->remote_addr, buf[0], sizeof(buf[0])),
|
||||||
(const char *)arg);
|
(const char *)arg);
|
||||||
|
|
||||||
nhrp_reqid_free(&nhrp_event_reqid, r);
|
nhrp_reqid_free(&nhrp_event_reqid, r);
|
||||||
@ -377,7 +377,7 @@ int nhrp_cache_update_binding(struct nhrp_cache *c, enum nhrp_cache_type type,
|
|||||||
c->cur.remote_nbma_natoa = *nbma_oa;
|
c->cur.remote_nbma_natoa = *nbma_oa;
|
||||||
else
|
else
|
||||||
memset(&c->cur.remote_nbma_natoa, 0,
|
memset(&c->cur.remote_nbma_natoa, 0,
|
||||||
sizeof c->cur.remote_nbma_natoa);
|
sizeof(c->cur.remote_nbma_natoa));
|
||||||
nhrp_peer_unref(p);
|
nhrp_peer_unref(p);
|
||||||
} else {
|
} else {
|
||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
|
@ -200,7 +200,7 @@ static int evmgr_reconnect(struct thread *t)
|
|||||||
fd = sock_open_unix(nhrp_event_socket_path);
|
fd = sock_open_unix(nhrp_event_socket_path);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
zlog_warn("%s: failure connecting nhrp-event socket: %s",
|
zlog_warn("%s: failure connecting nhrp-event socket: %s",
|
||||||
__PRETTY_FUNCTION__, strerror(errno));
|
__func__, strerror(errno));
|
||||||
zbufq_reset(&evmgr->obuf);
|
zbufq_reset(&evmgr->obuf);
|
||||||
thread_add_timer(master, evmgr_reconnect, evmgr, 10,
|
thread_add_timer(master, evmgr_reconnect, evmgr, 10,
|
||||||
&evmgr->t_reconnect);
|
&evmgr->t_reconnect);
|
||||||
|
@ -112,7 +112,7 @@ static void nhrp_interface_interface_notifier(struct notifier_block *n,
|
|||||||
NOTIFY_INTERFACE_NBMA_CHANGED);
|
NOTIFY_INTERFACE_NBMA_CHANGED);
|
||||||
debugf(NHRP_DEBUG_IF, "%s: NBMA change: address %s",
|
debugf(NHRP_DEBUG_IF, "%s: NBMA change: address %s",
|
||||||
nifp->ifp->name,
|
nifp->ifp->name,
|
||||||
sockunion2str(&nifp->nbma, buf, sizeof buf));
|
sockunion2str(&nifp->nbma, buf, sizeof(buf)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@ static void nhrp_interface_update_address(struct interface *ifp, afi_t afi,
|
|||||||
if (best && if_ad->configured
|
if (best && if_ad->configured
|
||||||
&& best->address->prefixlen != 8 * prefix_blen(best->address)) {
|
&& best->address->prefixlen != 8 * prefix_blen(best->address)) {
|
||||||
zlog_notice("%s: %s is not a host prefix", ifp->name,
|
zlog_notice("%s: %s is not a host prefix", ifp->name,
|
||||||
prefix2str(best->address, buf, sizeof buf));
|
prefix2str(best->address, buf, sizeof(buf)));
|
||||||
best = NULL;
|
best = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ static void nhrp_interface_update_address(struct interface *ifp, afi_t afi,
|
|||||||
|
|
||||||
debugf(NHRP_DEBUG_KERNEL, "%s: IPv%d address changed to %s", ifp->name,
|
debugf(NHRP_DEBUG_KERNEL, "%s: IPv%d address changed to %s", ifp->name,
|
||||||
afi == AFI_IP ? 4 : 6,
|
afi == AFI_IP ? 4 : 6,
|
||||||
best ? prefix2str(best->address, buf, sizeof buf) : "(none)");
|
best ? prefix2str(best->address, buf, sizeof(buf)) : "(none)");
|
||||||
if_ad->addr = addr;
|
if_ad->addr = addr;
|
||||||
|
|
||||||
if (if_ad->configured && sockunion_family(&if_ad->addr) != AF_UNSPEC) {
|
if (if_ad->configured && sockunion_family(&if_ad->addr) != AF_UNSPEC) {
|
||||||
@ -342,7 +342,7 @@ int nhrp_interface_address_add(ZAPI_CALLBACK_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_IF, "if-addr-add: %s: %s", ifc->ifp->name,
|
debugf(NHRP_DEBUG_IF, "if-addr-add: %s: %s", ifc->ifp->name,
|
||||||
prefix2str(ifc->address, buf, sizeof buf));
|
prefix2str(ifc->address, buf, sizeof(buf)));
|
||||||
|
|
||||||
nhrp_interface_update_address(
|
nhrp_interface_update_address(
|
||||||
ifc->ifp, family2afi(PREFIX_FAMILY(ifc->address)), 0);
|
ifc->ifp, family2afi(PREFIX_FAMILY(ifc->address)), 0);
|
||||||
@ -360,7 +360,7 @@ int nhrp_interface_address_delete(ZAPI_CALLBACK_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_IF, "if-addr-del: %s: %s", ifc->ifp->name,
|
debugf(NHRP_DEBUG_IF, "if-addr-del: %s: %s", ifc->ifp->name,
|
||||||
prefix2str(ifc->address, buf, sizeof buf));
|
prefix2str(ifc->address, buf, sizeof(buf)));
|
||||||
|
|
||||||
nhrp_interface_update_address(
|
nhrp_interface_update_address(
|
||||||
ifc->ifp, family2afi(PREFIX_FAMILY(ifc->address)), 0);
|
ifc->ifp, family2afi(PREFIX_FAMILY(ifc->address)), 0);
|
||||||
|
@ -136,7 +136,7 @@ static void nhrp_reg_peer_notify(struct notifier_block *n, unsigned long cmd)
|
|||||||
case NOTIFY_PEER_MTU_CHANGED:
|
case NOTIFY_PEER_MTU_CHANGED:
|
||||||
debugf(NHRP_DEBUG_COMMON, "NHS: Flush timer for %s",
|
debugf(NHRP_DEBUG_COMMON, "NHS: Flush timer for %s",
|
||||||
sockunion2str(&r->peer->vc->remote.nbma, buf,
|
sockunion2str(&r->peer->vc->remote.nbma, buf,
|
||||||
sizeof buf));
|
sizeof(buf)));
|
||||||
THREAD_TIMER_OFF(r->t_register);
|
THREAD_TIMER_OFF(r->t_register);
|
||||||
thread_add_timer_msec(master, nhrp_reg_send_req, r, 10,
|
thread_add_timer_msec(master, nhrp_reg_send_req, r, 10,
|
||||||
&r->t_register);
|
&r->t_register);
|
||||||
@ -162,7 +162,7 @@ static int nhrp_reg_send_req(struct thread *t)
|
|||||||
if (!nhrp_peer_check(r->peer, 2)) {
|
if (!nhrp_peer_check(r->peer, 2)) {
|
||||||
debugf(NHRP_DEBUG_COMMON, "NHS: Waiting link for %s",
|
debugf(NHRP_DEBUG_COMMON, "NHS: Waiting link for %s",
|
||||||
sockunion2str(&r->peer->vc->remote.nbma, buf1,
|
sockunion2str(&r->peer->vc->remote.nbma, buf1,
|
||||||
sizeof buf1));
|
sizeof(buf1)));
|
||||||
thread_add_timer(master, nhrp_reg_send_req, r, 120,
|
thread_add_timer(master, nhrp_reg_send_req, r, 120,
|
||||||
&r->t_register);
|
&r->t_register);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -305,8 +305,8 @@ void nhrp_peer_send(struct nhrp_peer *p, struct zbuf *zb)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_KERNEL, "PACKET: Send %s -> %s",
|
debugf(NHRP_DEBUG_KERNEL, "PACKET: Send %s -> %s",
|
||||||
sockunion2str(&p->vc->local.nbma, buf[0], sizeof buf[0]),
|
sockunion2str(&p->vc->local.nbma, buf[0], sizeof(buf[0])),
|
||||||
sockunion2str(&p->vc->remote.nbma, buf[1], sizeof buf[1]));
|
sockunion2str(&p->vc->remote.nbma, buf[1], sizeof(buf[1])));
|
||||||
|
|
||||||
os_sendmsg(zb->head, zbuf_used(zb), p->ifp->ifindex,
|
os_sendmsg(zb->head, zbuf_used(zb), p->ifp->ifindex,
|
||||||
sockunion_get_addr(&p->vc->remote.nbma),
|
sockunion_get_addr(&p->vc->remote.nbma),
|
||||||
@ -650,15 +650,15 @@ void nhrp_peer_send_indication(struct interface *ifp, uint16_t protocol_type,
|
|||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
"Send Traffic Indication to %s about packet to %s ignored",
|
"Send Traffic Indication to %s about packet to %s ignored",
|
||||||
sockunion2str(&p->vc->remote.nbma, buf[0],
|
sockunion2str(&p->vc->remote.nbma, buf[0],
|
||||||
sizeof buf[0]),
|
sizeof(buf[0])),
|
||||||
sockunion2str(&dst, buf[1], sizeof buf[1]));
|
sockunion2str(&dst, buf[1], sizeof(buf[1])));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
"Send Traffic Indication to %s (online=%d) about packet to %s",
|
"Send Traffic Indication to %s (online=%d) about packet to %s",
|
||||||
sockunion2str(&p->vc->remote.nbma, buf[0], sizeof buf[0]),
|
sockunion2str(&p->vc->remote.nbma, buf[0], sizeof(buf[0])),
|
||||||
p->online, sockunion2str(&dst, buf[1], sizeof buf[1]));
|
p->online, sockunion2str(&dst, buf[1], sizeof(buf[1])));
|
||||||
|
|
||||||
/* Create reply */
|
/* Create reply */
|
||||||
zb = zbuf_alloc(1500);
|
zb = zbuf_alloc(1500);
|
||||||
@ -688,8 +688,8 @@ static void nhrp_handle_error_ind(struct nhrp_packet_parser *pp)
|
|||||||
|
|
||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
"Error Indication from %s about packet to %s ignored",
|
"Error Indication from %s about packet to %s ignored",
|
||||||
sockunion2str(&pp->src_proto, buf[0], sizeof buf[0]),
|
sockunion2str(&pp->src_proto, buf[0], sizeof(buf[0])),
|
||||||
sockunion2str(&dst_proto, buf[1], sizeof buf[1]));
|
sockunion2str(&dst_proto, buf[1], sizeof(buf[1])));
|
||||||
|
|
||||||
reqid = nhrp_reqid_lookup(&nhrp_packet_reqid, htonl(hdr->u.request_id));
|
reqid = nhrp_reqid_lookup(&nhrp_packet_reqid, htonl(hdr->u.request_id));
|
||||||
if (reqid)
|
if (reqid)
|
||||||
@ -707,8 +707,8 @@ static void nhrp_handle_traffic_ind(struct nhrp_packet_parser *p)
|
|||||||
|
|
||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
"Traffic Indication from %s about packet to %s: %s",
|
"Traffic Indication from %s about packet to %s: %s",
|
||||||
sockunion2str(&p->src_proto, buf[0], sizeof buf[0]),
|
sockunion2str(&p->src_proto, buf[0], sizeof(buf[0])),
|
||||||
sockunion2str(&dst, buf[1], sizeof buf[1]),
|
sockunion2str(&dst, buf[1], sizeof(buf[1])),
|
||||||
(p->if_ad->flags & NHRP_IFF_SHORTCUT) ? "trying shortcut"
|
(p->if_ad->flags & NHRP_IFF_SHORTCUT) ? "trying shortcut"
|
||||||
: "ignored");
|
: "ignored");
|
||||||
|
|
||||||
@ -821,10 +821,9 @@ static void nhrp_peer_forward(struct nhrp_peer *p,
|
|||||||
if ((type == NHRP_EXTENSION_REVERSE_TRANSIT_NHS)
|
if ((type == NHRP_EXTENSION_REVERSE_TRANSIT_NHS)
|
||||||
== (packet_types[hdr->type].type == PACKET_REPLY)) {
|
== (packet_types[hdr->type].type == PACKET_REPLY)) {
|
||||||
/* Check NHS list for forwarding loop */
|
/* Check NHS list for forwarding loop */
|
||||||
while ((cie = nhrp_cie_pull(&extpl, pp->hdr,
|
while (nhrp_cie_pull(&extpl, pp->hdr,
|
||||||
&cie_nbma,
|
&cie_nbma,
|
||||||
&cie_protocol))
|
&cie_protocol) != NULL) {
|
||||||
!= NULL) {
|
|
||||||
if (sockunion_same(&p->vc->remote.nbma,
|
if (sockunion_same(&p->vc->remote.nbma,
|
||||||
&cie_nbma))
|
&cie_nbma))
|
||||||
goto err;
|
goto err;
|
||||||
@ -876,8 +875,8 @@ static void nhrp_packet_debug(struct zbuf *zb, const char *dir)
|
|||||||
zbuf_init(&zhdr, zb->buf, zb->tail - zb->buf, zb->tail - zb->buf);
|
zbuf_init(&zhdr, zb->buf, zb->tail - zb->buf, zb->tail - zb->buf);
|
||||||
hdr = nhrp_packet_pull(&zhdr, &src_nbma, &src_proto, &dst_proto);
|
hdr = nhrp_packet_pull(&zhdr, &src_nbma, &src_proto, &dst_proto);
|
||||||
|
|
||||||
sockunion2str(&src_proto, buf[0], sizeof buf[0]);
|
sockunion2str(&src_proto, buf[0], sizeof(buf[0]));
|
||||||
sockunion2str(&dst_proto, buf[1], sizeof buf[1]);
|
sockunion2str(&dst_proto, buf[1], sizeof(buf[1]));
|
||||||
|
|
||||||
reply = packet_types[hdr->type].type == PACKET_REPLY;
|
reply = packet_types[hdr->type].type == PACKET_REPLY;
|
||||||
debugf(NHRP_DEBUG_COMMON, "%s %s(%d) %s -> %s", dir,
|
debugf(NHRP_DEBUG_COMMON, "%s %s(%d) %s -> %s", dir,
|
||||||
@ -919,8 +918,8 @@ void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb)
|
|||||||
afi_t nbma_afi, proto_afi;
|
afi_t nbma_afi, proto_afi;
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_KERNEL, "PACKET: Recv %s -> %s",
|
debugf(NHRP_DEBUG_KERNEL, "PACKET: Recv %s -> %s",
|
||||||
sockunion2str(&vc->remote.nbma, buf[0], sizeof buf[0]),
|
sockunion2str(&vc->remote.nbma, buf[0], sizeof(buf[0])),
|
||||||
sockunion2str(&vc->local.nbma, buf[1], sizeof buf[1]));
|
sockunion2str(&vc->local.nbma, buf[1], sizeof(buf[1])));
|
||||||
|
|
||||||
if (!p->online) {
|
if (!p->online) {
|
||||||
info = "peer not online";
|
info = "peer not online";
|
||||||
@ -952,7 +951,7 @@ void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb)
|
|||||||
|| htons(hdr->packet_size) > realsize) {
|
|| htons(hdr->packet_size) > realsize) {
|
||||||
zlog_info(
|
zlog_info(
|
||||||
"From %s: error: packet type %d, version %d, AFI %d, proto %x, size %d (real size %d)",
|
"From %s: error: packet type %d, version %d, AFI %d, proto %x, size %d (real size %d)",
|
||||||
sockunion2str(&vc->remote.nbma, buf[0], sizeof buf[0]),
|
sockunion2str(&vc->remote.nbma, buf[0], sizeof(buf[0])),
|
||||||
(int)hdr->type, (int)hdr->version, (int)nbma_afi,
|
(int)hdr->type, (int)hdr->version, (int)nbma_afi,
|
||||||
(int)htons(hdr->protocol_type),
|
(int)htons(hdr->protocol_type),
|
||||||
(int)htons(hdr->packet_size), (int)realsize);
|
(int)htons(hdr->packet_size), (int)realsize);
|
||||||
@ -1033,7 +1032,7 @@ drop:
|
|||||||
if (info) {
|
if (info) {
|
||||||
zlog_info(
|
zlog_info(
|
||||||
"From %s: error: %s",
|
"From %s: error: %s",
|
||||||
sockunion2str(&vc->remote.nbma, buf[0], sizeof buf[0]),
|
sockunion2str(&vc->remote.nbma, buf[0], sizeof(buf[0])),
|
||||||
info);
|
info);
|
||||||
}
|
}
|
||||||
if (peer)
|
if (peer)
|
||||||
|
@ -220,8 +220,8 @@ int nhrp_route_read(ZAPI_CALLBACK_ARGS)
|
|||||||
added = (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD);
|
added = (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD);
|
||||||
debugf(NHRP_DEBUG_ROUTE, "if-route-%s: %s via %s dev %s",
|
debugf(NHRP_DEBUG_ROUTE, "if-route-%s: %s via %s dev %s",
|
||||||
added ? "add" : "del",
|
added ? "add" : "del",
|
||||||
prefix2str(&api.prefix, buf[0], sizeof buf[0]),
|
prefix2str(&api.prefix, buf[0], sizeof(buf[0])),
|
||||||
sockunion2str(&nexthop_addr, buf[1], sizeof buf[1]),
|
sockunion2str(&nexthop_addr, buf[1], sizeof(buf[1])),
|
||||||
ifp ? ifp->name : "(none)");
|
ifp ? ifp->name : "(none)");
|
||||||
|
|
||||||
nhrp_route_update_zebra(&api.prefix, &nexthop_addr, ifp);
|
nhrp_route_update_zebra(&api.prefix, &nexthop_addr, ifp);
|
||||||
@ -248,7 +248,7 @@ int nhrp_route_get_nexthop(const union sockunion *addr, struct prefix *p,
|
|||||||
ri = rn->info;
|
ri = rn->info;
|
||||||
if (ri->nhrp_ifp) {
|
if (ri->nhrp_ifp) {
|
||||||
debugf(NHRP_DEBUG_ROUTE, "lookup %s: nhrp_if=%s",
|
debugf(NHRP_DEBUG_ROUTE, "lookup %s: nhrp_if=%s",
|
||||||
prefix2str(&lookup, buf, sizeof buf),
|
prefix2str(&lookup, buf, sizeof(buf)),
|
||||||
ri->nhrp_ifp->name);
|
ri->nhrp_ifp->name);
|
||||||
|
|
||||||
if (via)
|
if (via)
|
||||||
@ -257,7 +257,7 @@ int nhrp_route_get_nexthop(const union sockunion *addr, struct prefix *p,
|
|||||||
*ifp = ri->nhrp_ifp;
|
*ifp = ri->nhrp_ifp;
|
||||||
} else {
|
} else {
|
||||||
debugf(NHRP_DEBUG_ROUTE, "lookup %s: zebra route dev %s",
|
debugf(NHRP_DEBUG_ROUTE, "lookup %s: zebra route dev %s",
|
||||||
prefix2str(&lookup, buf, sizeof buf),
|
prefix2str(&lookup, buf, sizeof(buf)),
|
||||||
ri->ifp ? ri->ifp->name : "(none)");
|
ri->ifp ? ri->ifp->name : "(none)");
|
||||||
|
|
||||||
if (via)
|
if (via)
|
||||||
|
@ -32,7 +32,7 @@ static void nhrp_shortcut_check_use(struct nhrp_shortcut *s)
|
|||||||
|
|
||||||
if (s->expiring && s->cache && s->cache->used) {
|
if (s->expiring && s->cache && s->cache->used) {
|
||||||
debugf(NHRP_DEBUG_ROUTE, "Shortcut %s used and expiring",
|
debugf(NHRP_DEBUG_ROUTE, "Shortcut %s used and expiring",
|
||||||
prefix2str(s->p, buf, sizeof buf));
|
prefix2str(s->p, buf, sizeof(buf)));
|
||||||
nhrp_shortcut_send_resolution_req(s);
|
nhrp_shortcut_send_resolution_req(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@ static void nhrp_shortcut_delete(struct nhrp_shortcut *s)
|
|||||||
nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid);
|
nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid);
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_ROUTE, "Shortcut %s purged",
|
debugf(NHRP_DEBUG_ROUTE, "Shortcut %s purged",
|
||||||
prefix2str(s->p, buf, sizeof buf));
|
prefix2str(s->p, buf, sizeof(buf)));
|
||||||
|
|
||||||
nhrp_shortcut_update_binding(s, NHRP_CACHE_INVALID, NULL, 0);
|
nhrp_shortcut_update_binding(s, NHRP_CACHE_INVALID, NULL, 0);
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ static struct nhrp_shortcut *nhrp_shortcut_get(struct prefix *p)
|
|||||||
s->p = &rn->p;
|
s->p = &rn->p;
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_ROUTE, "Shortcut %s created",
|
debugf(NHRP_DEBUG_ROUTE, "Shortcut %s created",
|
||||||
prefix2str(s->p, buf, sizeof buf));
|
prefix2str(s->p, buf, sizeof(buf)));
|
||||||
} else {
|
} else {
|
||||||
s = rn->info;
|
s = rn->info;
|
||||||
route_unlock_node(rn);
|
route_unlock_node(rn);
|
||||||
@ -246,7 +246,7 @@ static void nhrp_shortcut_recv_resolution_rep(struct nhrp_reqid *reqid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Parse extensions */
|
/* Parse extensions */
|
||||||
memset(&nat_nbma, 0, sizeof nat_nbma);
|
memset(&nat_nbma, 0, sizeof(nat_nbma));
|
||||||
while ((ext = nhrp_ext_pull(&pp->extensions, &extpl)) != NULL) {
|
while ((ext = nhrp_ext_pull(&pp->extensions, &extpl)) != NULL) {
|
||||||
switch (htons(ext->type) & ~NHRP_EXTENSION_FLAG_COMPULSORY) {
|
switch (htons(ext->type) & ~NHRP_EXTENSION_FLAG_COMPULSORY) {
|
||||||
case NHRP_EXTENSION_NAT_ADDRESS:
|
case NHRP_EXTENSION_NAT_ADDRESS:
|
||||||
@ -260,8 +260,8 @@ static void nhrp_shortcut_recv_resolution_rep(struct nhrp_reqid *reqid,
|
|||||||
if (!sockunion_same(&cie_proto, &pp->dst_proto)) {
|
if (!sockunion_same(&cie_proto, &pp->dst_proto)) {
|
||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
"Shortcut: Warning dst_proto altered from %s to %s",
|
"Shortcut: Warning dst_proto altered from %s to %s",
|
||||||
sockunion2str(&cie_proto, buf[0], sizeof buf[0]),
|
sockunion2str(&cie_proto, buf[0], sizeof(buf[0])),
|
||||||
sockunion2str(&pp->dst_proto, buf[1], sizeof buf[1]));
|
sockunion2str(&pp->dst_proto, buf[1], sizeof(buf[1])));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* One or more CIEs should be given as reply, we support only one */
|
/* One or more CIEs should be given as reply, we support only one */
|
||||||
@ -291,9 +291,8 @@ static void nhrp_shortcut_recv_resolution_rep(struct nhrp_reqid *reqid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
"Shortcut: %s is at proto %s dst_proto %s cie-nbma %s nat-nbma "
|
"Shortcut: %s is at proto %s dst_proto %s cie-nbma %s nat-nbma %s cie-holdtime %d",
|
||||||
"%s cie-holdtime %d",
|
prefix2str(&prefix, bufp, sizeof(bufp)),
|
||||||
prefix2str(&prefix, bufp, sizeof bufp),
|
|
||||||
sockunion2str(proto, buf[0], sizeof(buf[0])),
|
sockunion2str(proto, buf[0], sizeof(buf[0])),
|
||||||
sockunion2str(&pp->dst_proto, buf[1], sizeof(buf[1])),
|
sockunion2str(&pp->dst_proto, buf[1], sizeof(buf[1])),
|
||||||
sockunion2str(&cie_nbma, buf[2], sizeof(buf[2])),
|
sockunion2str(&cie_nbma, buf[2], sizeof(buf[2])),
|
||||||
|
@ -142,8 +142,8 @@ int nhrp_vc_ipsec_updown(uint32_t child_id, struct nhrp_vc *vc)
|
|||||||
sa->vc->abort_migration = 0;
|
sa->vc->abort_migration = 0;
|
||||||
debugf(NHRP_DEBUG_COMMON, "IPsec NBMA change of %s to %s",
|
debugf(NHRP_DEBUG_COMMON, "IPsec NBMA change of %s to %s",
|
||||||
sockunion2str(&sa->vc->remote.nbma, buf[0],
|
sockunion2str(&sa->vc->remote.nbma, buf[0],
|
||||||
sizeof buf[0]),
|
sizeof(buf[0])),
|
||||||
sockunion2str(&vc->remote.nbma, buf[1], sizeof buf[1]));
|
sockunion2str(&vc->remote.nbma, buf[1], sizeof(buf[1])));
|
||||||
nhrp_vc_update(sa->vc, NOTIFY_VC_IPSEC_UPDATE_NBMA);
|
nhrp_vc_update(sa->vc, NOTIFY_VC_IPSEC_UPDATE_NBMA);
|
||||||
abort_migration = sa->vc->abort_migration;
|
abort_migration = sa->vc->abort_migration;
|
||||||
}
|
}
|
||||||
|
@ -613,9 +613,9 @@ static void show_ip_nhrp_cache(struct nhrp_cache *c, void *pctx)
|
|||||||
|
|
||||||
vty_out(ctx->vty, "%-8s %-8s %-24s %-24s %c%c%c %s\n", c->ifp->name,
|
vty_out(ctx->vty, "%-8s %-8s %-24s %-24s %c%c%c %s\n", c->ifp->name,
|
||||||
nhrp_cache_type_str[c->cur.type],
|
nhrp_cache_type_str[c->cur.type],
|
||||||
sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]),
|
sockunion2str(&c->remote_addr, buf[0], sizeof(buf[0])),
|
||||||
c->cur.peer ? sockunion2str(&c->cur.peer->vc->remote.nbma,
|
c->cur.peer ? sockunion2str(&c->cur.peer->vc->remote.nbma,
|
||||||
buf[1], sizeof buf[1])
|
buf[1], sizeof(buf[1]))
|
||||||
: "-",
|
: "-",
|
||||||
c->used ? 'U' : ' ', c->t_timeout ? 'T' : ' ',
|
c->used ? 'U' : ' ', c->t_timeout ? 'T' : ' ',
|
||||||
c->t_auth ? 'A' : ' ',
|
c->t_auth ? 'A' : ' ',
|
||||||
@ -637,10 +637,10 @@ static void show_ip_nhrp_nhs(struct nhrp_nhs *n, struct nhrp_registration *reg,
|
|||||||
|
|
||||||
vty_out(vty, "%-8s %-24s %-16s %-16s\n", n->ifp->name, n->nbma_fqdn,
|
vty_out(vty, "%-8s %-24s %-16s %-16s\n", n->ifp->name, n->nbma_fqdn,
|
||||||
(reg && reg->peer) ? sockunion2str(®->peer->vc->remote.nbma,
|
(reg && reg->peer) ? sockunion2str(®->peer->vc->remote.nbma,
|
||||||
buf[0], sizeof buf[0])
|
buf[0], sizeof(buf[0]))
|
||||||
: "-",
|
: "-",
|
||||||
sockunion2str(reg ? ®->proto_addr : &n->proto_addr, buf[1],
|
sockunion2str(reg ? ®->proto_addr : &n->proto_addr, buf[1],
|
||||||
sizeof buf[1]));
|
sizeof(buf[1])));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_ip_nhrp_shortcut(struct nhrp_shortcut *s, void *pctx)
|
static void show_ip_nhrp_shortcut(struct nhrp_shortcut *s, void *pctx)
|
||||||
@ -658,8 +658,8 @@ static void show_ip_nhrp_shortcut(struct nhrp_shortcut *s, void *pctx)
|
|||||||
|
|
||||||
c = s->cache;
|
c = s->cache;
|
||||||
vty_out(ctx->vty, "%-8s %-24s %-24s %s\n", nhrp_cache_type_str[s->type],
|
vty_out(ctx->vty, "%-8s %-24s %-24s %s\n", nhrp_cache_type_str[s->type],
|
||||||
prefix2str(s->p, buf1, sizeof buf1),
|
prefix2str(s->p, buf1, sizeof(buf1)),
|
||||||
c ? sockunion2str(&c->remote_addr, buf2, sizeof buf2) : "",
|
c ? sockunion2str(&c->remote_addr, buf2, sizeof(buf2)) : "",
|
||||||
(c && c->cur.peer) ? c->cur.peer->vc->remote.id : "");
|
(c && c->cur.peer) ? c->cur.peer->vc->remote.id : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -678,19 +678,19 @@ static void show_ip_opennhrp_cache(struct nhrp_cache *c, void *pctx)
|
|||||||
nhrp_cache_type_str[c->cur.type],
|
nhrp_cache_type_str[c->cur.type],
|
||||||
(c->cur.peer && c->cur.peer->online) ? " up" : "",
|
(c->cur.peer && c->cur.peer->online) ? " up" : "",
|
||||||
c->used ? " used" : "",
|
c->used ? " used" : "",
|
||||||
sockunion2str(&c->remote_addr, buf, sizeof buf),
|
sockunion2str(&c->remote_addr, buf, sizeof(buf)),
|
||||||
8 * family2addrsize(sockunion_family(&c->remote_addr)));
|
8 * family2addrsize(sockunion_family(&c->remote_addr)));
|
||||||
|
|
||||||
if (c->cur.peer) {
|
if (c->cur.peer) {
|
||||||
vty_out(ctx->vty, "NBMA-Address: %s\n",
|
vty_out(ctx->vty, "NBMA-Address: %s\n",
|
||||||
sockunion2str(&c->cur.peer->vc->remote.nbma, buf,
|
sockunion2str(&c->cur.peer->vc->remote.nbma, buf,
|
||||||
sizeof buf));
|
sizeof(buf)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sockunion_family(&c->cur.remote_nbma_natoa) != AF_UNSPEC) {
|
if (sockunion_family(&c->cur.remote_nbma_natoa) != AF_UNSPEC) {
|
||||||
vty_out(ctx->vty, "NBMA-NAT-OA-Address: %s\n",
|
vty_out(ctx->vty, "NBMA-NAT-OA-Address: %s\n",
|
||||||
sockunion2str(&c->cur.remote_nbma_natoa, buf,
|
sockunion2str(&c->cur.remote_nbma_natoa, buf,
|
||||||
sizeof buf));
|
sizeof(buf)));
|
||||||
}
|
}
|
||||||
|
|
||||||
vty_out(ctx->vty, "\n\n");
|
vty_out(ctx->vty, "\n\n");
|
||||||
@ -741,8 +741,8 @@ static void show_dmvpn_entry(struct nhrp_vc *vc, void *ctx)
|
|||||||
char buf[2][SU_ADDRSTRLEN];
|
char buf[2][SU_ADDRSTRLEN];
|
||||||
|
|
||||||
vty_out(vty, "%-24s %-24s %c %-4d %-24s\n",
|
vty_out(vty, "%-24s %-24s %c %-4d %-24s\n",
|
||||||
sockunion2str(&vc->local.nbma, buf[0], sizeof buf[0]),
|
sockunion2str(&vc->local.nbma, buf[0], sizeof(buf[0])),
|
||||||
sockunion2str(&vc->remote.nbma, buf[1], sizeof buf[1]),
|
sockunion2str(&vc->remote.nbma, buf[1], sizeof(buf[1])),
|
||||||
notifier_active(&vc->notifier_list) ? 'n' : ' ', vc->ipsec,
|
notifier_active(&vc->notifier_list) ? 'n' : ' ', vc->ipsec,
|
||||||
vc->remote.id);
|
vc->remote.id);
|
||||||
}
|
}
|
||||||
@ -824,11 +824,11 @@ static void interface_config_write_nhrp_map(struct nhrp_cache *c, void *data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
vty_out(vty, " %s nhrp map %s %s\n", ctx->aficmd,
|
vty_out(vty, " %s nhrp map %s %s\n", ctx->aficmd,
|
||||||
sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]),
|
sockunion2str(&c->remote_addr, buf[0], sizeof(buf[0])),
|
||||||
c->cur.type == NHRP_CACHE_LOCAL
|
c->cur.type == NHRP_CACHE_LOCAL
|
||||||
? "local"
|
? "local"
|
||||||
: sockunion2str(&c->cur.peer->vc->remote.nbma, buf[1],
|
: sockunion2str(&c->cur.peer->vc->remote.nbma, buf[1],
|
||||||
sizeof buf[1]));
|
sizeof(buf[1])));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int interface_config_write(struct vty *vty)
|
static int interface_config_write(struct vty *vty)
|
||||||
@ -904,7 +904,7 @@ static int interface_config_write(struct vty *vty)
|
|||||||
? "dynamic"
|
? "dynamic"
|
||||||
: sockunion2str(
|
: sockunion2str(
|
||||||
&nhs->proto_addr, buf,
|
&nhs->proto_addr, buf,
|
||||||
sizeof buf),
|
sizeof(buf)),
|
||||||
nhs->nbma_fqdn);
|
nhs->nbma_fqdn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
nhrpd/vici.c
10
nhrpd/vici.c
@ -303,7 +303,7 @@ static void vici_recv_sa(struct vici_conn *vici, struct zbuf *msg, int event)
|
|||||||
if (ctx.kill_ikesa && ctx.ike_uniqueid) {
|
if (ctx.kill_ikesa && ctx.ike_uniqueid) {
|
||||||
debugf(NHRP_DEBUG_COMMON, "VICI: Deleting IKE_SA %u",
|
debugf(NHRP_DEBUG_COMMON, "VICI: Deleting IKE_SA %u",
|
||||||
ctx.ike_uniqueid);
|
ctx.ike_uniqueid);
|
||||||
snprintf(buf, sizeof buf, "%u", ctx.ike_uniqueid);
|
snprintf(buf, sizeof(buf), "%u", ctx.ike_uniqueid);
|
||||||
vici_submit_request(vici, "terminate", VICI_KEY_VALUE, "ike-id",
|
vici_submit_request(vici, "terminate", VICI_KEY_VALUE, "ike-id",
|
||||||
strlen(buf), buf, VICI_END);
|
strlen(buf), buf, VICI_END);
|
||||||
}
|
}
|
||||||
@ -481,8 +481,8 @@ static int vici_reconnect(struct thread *t)
|
|||||||
fd = sock_open_unix("/var/run/charon.vici");
|
fd = sock_open_unix("/var/run/charon.vici");
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
debugf(NHRP_DEBUG_VICI,
|
debugf(NHRP_DEBUG_VICI,
|
||||||
"%s: failure connecting VICI socket: %s",
|
"%s: failure connecting VICI socket: %s", __func__,
|
||||||
__PRETTY_FUNCTION__, strerror(errno));
|
strerror(errno));
|
||||||
thread_add_timer(master, vici_reconnect, vici, 2,
|
thread_add_timer(master, vici_reconnect, vici, 2,
|
||||||
&vici->t_reconnect);
|
&vici->t_reconnect);
|
||||||
return 0;
|
return 0;
|
||||||
@ -527,8 +527,8 @@ void vici_request_vc(const char *profile, union sockunion *src,
|
|||||||
struct vici_conn *vici = &vici_connection;
|
struct vici_conn *vici = &vici_connection;
|
||||||
char buf[2][SU_ADDRSTRLEN];
|
char buf[2][SU_ADDRSTRLEN];
|
||||||
|
|
||||||
sockunion2str(src, buf[0], sizeof buf[0]);
|
sockunion2str(src, buf[0], sizeof(buf[0]));
|
||||||
sockunion2str(dst, buf[1], sizeof buf[1]);
|
sockunion2str(dst, buf[1], sizeof(buf[1]));
|
||||||
|
|
||||||
vici_submit_request(vici, "initiate", VICI_KEY_VALUE, "child",
|
vici_submit_request(vici, "initiate", VICI_KEY_VALUE, "child",
|
||||||
strlen(profile), profile, VICI_KEY_VALUE, "timeout",
|
strlen(profile), profile, VICI_KEY_VALUE, "timeout",
|
||||||
|
@ -232,8 +232,8 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
|
|||||||
&route->prefix)), buf,
|
&route->prefix)), buf,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s with cost %u is not best, ignore."
|
"%s: route %s with cost %u is not best, ignore.",
|
||||||
, __PRETTY_FUNCTION__, buf,
|
__func__, buf,
|
||||||
route->path.cost);
|
route->path.cost);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -246,9 +246,10 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
|
|||||||
if (is_debug) {
|
if (is_debug) {
|
||||||
prefix2str(&route->prefix, buf,
|
prefix2str(&route->prefix, buf,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug("%s: intra-prefix route %s with cost %u is not best, ignore."
|
zlog_debug(
|
||||||
, __PRETTY_FUNCTION__, buf,
|
"%s: intra-prefix route %s with cost %u is not best, ignore.",
|
||||||
route->path.cost);
|
__func__, buf,
|
||||||
|
route->path.cost);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -762,11 +763,13 @@ void ospf6_abr_old_path_update(struct ospf6_route *old_route,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IS_OSPF6_DEBUG_ABR || IS_OSPF6_DEBUG_EXAMIN(INTER_PREFIX))
|
if (IS_OSPF6_DEBUG_ABR || IS_OSPF6_DEBUG_EXAMIN(INTER_PREFIX))
|
||||||
zlog_debug("%s: paths %u nh %u", __PRETTY_FUNCTION__,
|
zlog_debug("%s: paths %u nh %u", __func__,
|
||||||
old_route->paths ?
|
old_route->paths
|
||||||
listcount(old_route->paths) : 0,
|
? listcount(old_route->paths)
|
||||||
old_route->nh_list ?
|
: 0,
|
||||||
listcount(old_route->nh_list) : 0);
|
old_route->nh_list
|
||||||
|
? listcount(old_route->nh_list)
|
||||||
|
: 0);
|
||||||
|
|
||||||
if (table->hook_add)
|
if (table->hook_add)
|
||||||
(*table->hook_add)(old_route);
|
(*table->hook_add)(old_route);
|
||||||
@ -822,9 +825,10 @@ void ospf6_abr_old_route_remove(struct ospf6_lsa *lsa,
|
|||||||
prefix2str(&old->prefix, buf,
|
prefix2str(&old->prefix, buf,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug("%s: old %s updated nh %u",
|
zlog_debug("%s: old %s updated nh %u",
|
||||||
__PRETTY_FUNCTION__, buf,
|
__func__, buf,
|
||||||
old->nh_list ?
|
old->nh_list ? listcount(
|
||||||
listcount(old->nh_list) : 0);
|
old->nh_list)
|
||||||
|
: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (table->hook_add)
|
if (table->hook_add)
|
||||||
@ -878,8 +882,8 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
if (lsa->header->type == htons(OSPF6_LSTYPE_INTER_PREFIX)) {
|
if (lsa->header->type == htons(OSPF6_LSTYPE_INTER_PREFIX)) {
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTER_PREFIX)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTER_PREFIX)) {
|
||||||
is_debug++;
|
is_debug++;
|
||||||
zlog_debug("%s: Examin %s in area %s",
|
zlog_debug("%s: Examin %s in area %s", __func__,
|
||||||
__PRETTY_FUNCTION__, lsa->name, oa->name);
|
lsa->name, oa->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix_lsa =
|
prefix_lsa =
|
||||||
@ -898,8 +902,8 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
} else if (lsa->header->type == htons(OSPF6_LSTYPE_INTER_ROUTER)) {
|
} else if (lsa->header->type == htons(OSPF6_LSTYPE_INTER_ROUTER)) {
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTER_ROUTER)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTER_ROUTER)) {
|
||||||
is_debug++;
|
is_debug++;
|
||||||
zlog_debug("%s: Examin %s in area %s",
|
zlog_debug("%s: Examin %s in area %s", __func__,
|
||||||
__PRETTY_FUNCTION__, lsa->name, oa->name);
|
lsa->name, oa->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
router_lsa =
|
router_lsa =
|
||||||
@ -946,9 +950,10 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
old = route;
|
old = route;
|
||||||
|
|
||||||
if (is_debug)
|
if (is_debug)
|
||||||
zlog_debug("%s: old entry found in paths, adv_router %s",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__,
|
"%s: old entry found in paths, adv_router %s",
|
||||||
adv_router);
|
__func__,
|
||||||
|
adv_router);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -973,8 +978,8 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
}
|
}
|
||||||
if (OSPF6_LSA_IS_MAXAGE(lsa)) {
|
if (OSPF6_LSA_IS_MAXAGE(lsa)) {
|
||||||
if (is_debug)
|
if (is_debug)
|
||||||
zlog_debug("%s: LSA %s is MaxAge, ignore",
|
zlog_debug("%s: LSA %s is MaxAge, ignore", __func__,
|
||||||
__PRETTY_FUNCTION__, lsa->name);
|
lsa->name);
|
||||||
if (old)
|
if (old)
|
||||||
ospf6_abr_old_route_remove(lsa, old, table);
|
ospf6_abr_old_route_remove(lsa, old, table);
|
||||||
return;
|
return;
|
||||||
@ -1053,21 +1058,21 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
|| CHECK_FLAG(abr_entry->flag, OSPF6_ROUTE_REMOVE)
|
|| CHECK_FLAG(abr_entry->flag, OSPF6_ROUTE_REMOVE)
|
||||||
|| !CHECK_FLAG(abr_entry->path.router_bits, OSPF6_ROUTER_BIT_B)) {
|
|| !CHECK_FLAG(abr_entry->path.router_bits, OSPF6_ROUTER_BIT_B)) {
|
||||||
if (is_debug)
|
if (is_debug)
|
||||||
zlog_debug("%s: ABR router entry does not exist, ignore",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__);
|
"%s: ABR router entry does not exist, ignore",
|
||||||
|
__func__);
|
||||||
if (old) {
|
if (old) {
|
||||||
if (old->type == OSPF6_DEST_TYPE_ROUTER &&
|
if (old->type == OSPF6_DEST_TYPE_ROUTER &&
|
||||||
oa->intra_brouter_calc) {
|
oa->intra_brouter_calc) {
|
||||||
if (is_debug)
|
if (is_debug)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: intra_brouter_calc is on, skip brouter remove: %s (%p)",
|
"%s: intra_brouter_calc is on, skip brouter remove: %s (%p)",
|
||||||
__PRETTY_FUNCTION__, buf,
|
__func__, buf, (void *)old);
|
||||||
(void *)old);
|
|
||||||
} else {
|
} else {
|
||||||
if (is_debug)
|
if (is_debug)
|
||||||
zlog_debug("%s: remove old entry: %s %p ",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s: remove old entry: %s %p ",
|
||||||
(void *)old);
|
__func__, buf, (void *)old);
|
||||||
ospf6_route_remove(old, table);
|
ospf6_route_remove(old, table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1142,11 +1147,10 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
if ((ospf6_route_cmp(route, old_route) != 0)) {
|
if ((ospf6_route_cmp(route, old_route) != 0)) {
|
||||||
if (is_debug) {
|
if (is_debug) {
|
||||||
prefix2str(&prefix, buf, sizeof(buf));
|
prefix2str(&prefix, buf, sizeof(buf));
|
||||||
zlog_debug("%s: old %p %s cost %u new route cost %u are not same",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__,
|
"%s: old %p %s cost %u new route cost %u are not same",
|
||||||
(void *)old_route, buf,
|
__func__, (void *)old_route, buf,
|
||||||
old_route->path.cost,
|
old_route->path.cost, route->path.cost);
|
||||||
route->path.cost);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check new route's adv. router is same in one of
|
/* Check new route's adv. router is same in one of
|
||||||
@ -1185,14 +1189,15 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
inet_ntop(AF_INET,
|
inet_ntop(AF_INET,
|
||||||
&ecmp_path->origin.adv_router,
|
&ecmp_path->origin.adv_router,
|
||||||
adv_router, sizeof(adv_router));
|
adv_router, sizeof(adv_router));
|
||||||
zlog_debug("%s: route %s cost %u another path %s added with nh %u, effective paths %u nh %u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s: route %s cost %u another path %s added with nh %u, effective paths %u nh %u",
|
||||||
old_route->path.cost,
|
__func__, buf, old_route->path.cost,
|
||||||
adv_router,
|
adv_router,
|
||||||
listcount(ecmp_path->nh_list),
|
listcount(ecmp_path->nh_list),
|
||||||
old_route->paths ?
|
old_route->paths
|
||||||
listcount(old_route->paths) : 0,
|
? listcount(old_route->paths)
|
||||||
listcount(old_route->nh_list));
|
: 0,
|
||||||
|
listcount(old_route->nh_list));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* adv. router exists in the list, update the nhs */
|
/* adv. router exists in the list, update the nhs */
|
||||||
@ -1201,10 +1206,11 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_debug)
|
if (is_debug)
|
||||||
zlog_debug("%s: Update route: %s %p old cost %u new cost %u nh %u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf, (void *)old_route,
|
"%s: Update route: %s %p old cost %u new cost %u nh %u",
|
||||||
old_route->path.cost, route->path.cost,
|
__func__, buf, (void *)old_route,
|
||||||
listcount(route->nh_list));
|
old_route->path.cost, route->path.cost,
|
||||||
|
listcount(route->nh_list));
|
||||||
|
|
||||||
/* For Inter-Prefix route: Update RIB/FIB,
|
/* For Inter-Prefix route: Update RIB/FIB,
|
||||||
* For Inter-Router trigger summary update
|
* For Inter-Router trigger summary update
|
||||||
@ -1221,9 +1227,10 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
if (is_debug) {
|
if (is_debug) {
|
||||||
inet_ntop(AF_INET, &route->path.origin.adv_router,
|
inet_ntop(AF_INET, &route->path.origin.adv_router,
|
||||||
adv_router, sizeof(adv_router));
|
adv_router, sizeof(adv_router));
|
||||||
zlog_debug("%s: Install route: %s cost %u nh %u adv_router %s ",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf, route->path.cost,
|
"%s: Install route: %s cost %u nh %u adv_router %s ",
|
||||||
listcount(route->nh_list), adv_router);
|
__func__, buf, route->path.cost,
|
||||||
|
listcount(route->nh_list), adv_router);
|
||||||
}
|
}
|
||||||
|
|
||||||
path = ospf6_path_dup(&route->path);
|
path = ospf6_path_dup(&route->path);
|
||||||
|
@ -61,8 +61,7 @@ static void ospf6_area_lsdb_hook_add(struct ospf6_lsa *lsa)
|
|||||||
case OSPF6_LSTYPE_ROUTER:
|
case OSPF6_LSTYPE_ROUTER:
|
||||||
case OSPF6_LSTYPE_NETWORK:
|
case OSPF6_LSTYPE_NETWORK:
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN_TYPE(lsa->header->type)) {
|
if (IS_OSPF6_DEBUG_EXAMIN_TYPE(lsa->header->type)) {
|
||||||
zlog_debug("%s Examin LSA %s", __PRETTY_FUNCTION__,
|
zlog_debug("%s Examin LSA %s", __func__, lsa->name);
|
||||||
lsa->name);
|
|
||||||
zlog_debug(" Schedule SPF Calculation for %s",
|
zlog_debug(" Schedule SPF Calculation for %s",
|
||||||
OSPF6_AREA(lsa->lsdb->data)->name);
|
OSPF6_AREA(lsa->lsdb->data)->name);
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ int ospf6_orig_as_external_lsa(struct thread *thread)
|
|||||||
if (IS_OSPF6_DEBUG_ASBR)
|
if (IS_OSPF6_DEBUG_ASBR)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Send update of AS-External LSA %s seq 0x%x",
|
"%s: Send update of AS-External LSA %s seq 0x%x",
|
||||||
__PRETTY_FUNCTION__, lsa->name,
|
__func__, lsa->name,
|
||||||
ntohl(lsa->header->seqnum));
|
ntohl(lsa->header->seqnum));
|
||||||
|
|
||||||
ospf6_flood_interface(NULL, lsa, oi);
|
ospf6_flood_interface(NULL, lsa, oi);
|
||||||
@ -245,7 +245,7 @@ void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old,
|
|||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s cost old %u new %u is not same, replace route",
|
"%s: route %s cost old %u new %u is not same, replace route",
|
||||||
__PRETTY_FUNCTION__, buf, o_path->cost,
|
__func__, buf, o_path->cost,
|
||||||
route->path.cost);
|
route->path.cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old,
|
|||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s old cost %u new cost %u, delete old entry.",
|
"%s: route %s old cost %u new cost %u, delete old entry.",
|
||||||
__PRETTY_FUNCTION__, buf,
|
__func__, buf,
|
||||||
old_route->path.cost,
|
old_route->path.cost,
|
||||||
route->path.cost);
|
route->path.cost);
|
||||||
}
|
}
|
||||||
@ -340,8 +340,7 @@ void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old,
|
|||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: old route %s path cost %u e2 %u",
|
"%s: old route %s path cost %u e2 %u",
|
||||||
__PRETTY_FUNCTION__, buf,
|
__func__, buf, old_route->path.cost,
|
||||||
old_route->path.cost,
|
|
||||||
old_route->path.u.cost_e2);
|
old_route->path.u.cost_e2);
|
||||||
}
|
}
|
||||||
route_found = true;
|
route_found = true;
|
||||||
@ -378,13 +377,11 @@ void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old,
|
|||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s another path added with nh %u, effective paths %u nh %u",
|
"%s: route %s another path added with nh %u, effective paths %u nh %u",
|
||||||
__PRETTY_FUNCTION__, buf,
|
__func__, buf,
|
||||||
listcount(ecmp_path->nh_list),
|
listcount(ecmp_path->nh_list),
|
||||||
old_route->paths
|
old_route->paths ? listcount(
|
||||||
? listcount(
|
old_route->paths)
|
||||||
old_route
|
: 0,
|
||||||
->paths)
|
|
||||||
: 0,
|
|
||||||
listcount(old_route->nh_list));
|
listcount(old_route->nh_list));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -410,9 +407,9 @@ void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old,
|
|||||||
AS_EXTERNAL)) {
|
AS_EXTERNAL)) {
|
||||||
prefix2str(&old_route->prefix,
|
prefix2str(&old_route->prefix,
|
||||||
buf, sizeof(buf));
|
buf, sizeof(buf));
|
||||||
zlog_debug("%s: ls_prfix %s asbr_entry not found.",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__,
|
"%s: ls_prfix %s asbr_entry not found.",
|
||||||
buf);
|
__func__, buf);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -422,12 +419,15 @@ void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old,
|
|||||||
|
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {
|
||||||
prefix2str(&route->prefix, buf, sizeof(buf));
|
prefix2str(&route->prefix, buf, sizeof(buf));
|
||||||
zlog_debug("%s: route %s with effective paths %u nh %u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s: route %s with effective paths %u nh %u",
|
||||||
old_route->paths ?
|
__func__, buf,
|
||||||
listcount(old_route->paths) : 0,
|
old_route->paths
|
||||||
old_route->nh_list ?
|
? listcount(old_route->paths)
|
||||||
listcount(old_route->nh_list) : 0);
|
: 0,
|
||||||
|
old_route->nh_list
|
||||||
|
? listcount(old_route->nh_list)
|
||||||
|
: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update RIB/FIB */
|
/* Update RIB/FIB */
|
||||||
@ -532,7 +532,7 @@ void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa)
|
|||||||
if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {
|
||||||
prefix2str(&route->prefix, buf, sizeof(buf));
|
prefix2str(&route->prefix, buf, sizeof(buf));
|
||||||
zlog_debug("%s: AS-External %u route add %s cost %u(%u) nh %u",
|
zlog_debug("%s: AS-External %u route add %s cost %u(%u) nh %u",
|
||||||
__PRETTY_FUNCTION__,
|
__func__,
|
||||||
(route->path.type == OSPF6_PATH_TYPE_EXTERNAL1) ? 1
|
(route->path.type == OSPF6_PATH_TYPE_EXTERNAL1) ? 1
|
||||||
: 2,
|
: 2,
|
||||||
buf, route->path.cost, route->path.u.cost_e2,
|
buf, route->path.cost, route->path.u.cost_e2,
|
||||||
@ -621,9 +621,8 @@ void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa,
|
|||||||
prefix2str(&prefix, buf, sizeof(buf));
|
prefix2str(&prefix, buf, sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Current route %s cost %u e2 %u, route to del cost %u e2 %u",
|
"%s: Current route %s cost %u e2 %u, route to del cost %u e2 %u",
|
||||||
__PRETTY_FUNCTION__, buf, route->path.cost,
|
__func__, buf, route->path.cost, route->path.u.cost_e2,
|
||||||
route->path.u.cost_e2, route_to_del->path.cost,
|
route_to_del->path.cost, route_to_del->path.u.cost_e2);
|
||||||
route_to_del->path.u.cost_e2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ospf6_route_lock(route);
|
for (ospf6_route_lock(route);
|
||||||
@ -670,8 +669,8 @@ void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa,
|
|||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s to delete is not same, cost %u del cost %u. skip",
|
"%s: route %s to delete is not same, cost %u del cost %u. skip",
|
||||||
__PRETTY_FUNCTION__,
|
__func__, buf,
|
||||||
buf, route->path.cost,
|
route->path.cost,
|
||||||
route_to_del->path
|
route_to_del->path
|
||||||
.cost);
|
.cost);
|
||||||
}
|
}
|
||||||
@ -682,8 +681,7 @@ void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa,
|
|||||||
prefix2str(&prefix, buf, sizeof(buf));
|
prefix2str(&prefix, buf, sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s path found with cost %u nh %u to remove.",
|
"%s: route %s path found with cost %u nh %u to remove.",
|
||||||
__PRETTY_FUNCTION__, buf,
|
__func__, buf, route->path.cost,
|
||||||
route->path.cost,
|
|
||||||
listcount(o_path->nh_list));
|
listcount(o_path->nh_list));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,14 +724,15 @@ void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa,
|
|||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: AS-External %u route %s update paths %u nh %u",
|
"%s: AS-External %u route %s update paths %u nh %u",
|
||||||
__PRETTY_FUNCTION__,
|
__func__,
|
||||||
(route->path.type
|
(route->path.type
|
||||||
== OSPF6_PATH_TYPE_EXTERNAL1)
|
== OSPF6_PATH_TYPE_EXTERNAL1)
|
||||||
? 1
|
? 1
|
||||||
: 2,
|
: 2,
|
||||||
buf, listcount(route->paths),
|
buf, listcount(route->paths),
|
||||||
route->nh_list ?
|
route->nh_list ? listcount(
|
||||||
listcount(route->nh_list) : 0);
|
route->nh_list)
|
||||||
|
: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listcount(route->paths)) {
|
if (listcount(route->paths)) {
|
||||||
@ -785,8 +784,7 @@ void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa,
|
|||||||
prefix2str(&prefix, buf, sizeof(buf));
|
prefix2str(&prefix, buf, sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s to delete is not same, cost %u del cost %u. skip",
|
"%s: route %s to delete is not same, cost %u del cost %u. skip",
|
||||||
__PRETTY_FUNCTION__, buf,
|
__func__, buf, route->path.cost,
|
||||||
route->path.cost,
|
|
||||||
route_to_del->path.cost);
|
route_to_del->path.cost);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@ -802,7 +800,7 @@ void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa,
|
|||||||
prefix2str(&route->prefix, buf, sizeof(buf));
|
prefix2str(&route->prefix, buf, sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: AS-External %u route remove %s cost %u(%u) nh %u",
|
"%s: AS-External %u route remove %s cost %u(%u) nh %u",
|
||||||
__PRETTY_FUNCTION__,
|
__func__,
|
||||||
route->path.type == OSPF6_PATH_TYPE_EXTERNAL1
|
route->path.type == OSPF6_PATH_TYPE_EXTERNAL1
|
||||||
? 1
|
? 1
|
||||||
: 2,
|
: 2,
|
||||||
@ -892,8 +890,7 @@ static int ospf6_asbr_routemap_update_timer(struct thread *thread)
|
|||||||
if (ospf6->rmap[arg_type].map) {
|
if (ospf6->rmap[arg_type].map) {
|
||||||
if (IS_OSPF6_DEBUG_ASBR)
|
if (IS_OSPF6_DEBUG_ASBR)
|
||||||
zlog_debug("%s: route-map %s update, reset redist %s",
|
zlog_debug("%s: route-map %s update, reset redist %s",
|
||||||
__PRETTY_FUNCTION__,
|
__func__, ospf6->rmap[arg_type].name,
|
||||||
ospf6->rmap[arg_type].name,
|
|
||||||
ZROUTE_NAME(arg_type));
|
ZROUTE_NAME(arg_type));
|
||||||
|
|
||||||
ospf6_zebra_no_redistribute(arg_type);
|
ospf6_zebra_no_redistribute(arg_type);
|
||||||
@ -917,8 +914,8 @@ void ospf6_asbr_distribute_list_update(int type)
|
|||||||
args[1] = (void *)((ptrdiff_t)type);
|
args[1] = (void *)((ptrdiff_t)type);
|
||||||
|
|
||||||
if (IS_OSPF6_DEBUG_ASBR)
|
if (IS_OSPF6_DEBUG_ASBR)
|
||||||
zlog_debug("%s: trigger redistribute %s reset thread",
|
zlog_debug("%s: trigger redistribute %s reset thread", __func__,
|
||||||
__PRETTY_FUNCTION__, ZROUTE_NAME(type));
|
ZROUTE_NAME(type));
|
||||||
|
|
||||||
ospf6->t_distribute_update = NULL;
|
ospf6->t_distribute_update = NULL;
|
||||||
thread_add_timer_msec(master, ospf6_asbr_routemap_update_timer,
|
thread_add_timer_msec(master, ospf6_asbr_routemap_update_timer,
|
||||||
@ -943,7 +940,7 @@ static void ospf6_asbr_routemap_update(const char *mapname)
|
|||||||
if (IS_OSPF6_DEBUG_ASBR)
|
if (IS_OSPF6_DEBUG_ASBR)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route-map %s update, reset redist %s",
|
"%s: route-map %s update, reset redist %s",
|
||||||
__PRETTY_FUNCTION__, mapname,
|
__func__, mapname,
|
||||||
ZROUTE_NAME(type));
|
ZROUTE_NAME(type));
|
||||||
|
|
||||||
route_map_counter_increment(
|
route_map_counter_increment(
|
||||||
|
@ -258,8 +258,8 @@ void ospf6_install_lsa(struct ospf6_lsa *lsa)
|
|||||||
if (IS_OSPF6_DEBUG_LSA_TYPE(lsa->header->type)
|
if (IS_OSPF6_DEBUG_LSA_TYPE(lsa->header->type)
|
||||||
|| IS_OSPF6_DEBUG_EXAMIN_TYPE(lsa->header->type))
|
|| IS_OSPF6_DEBUG_EXAMIN_TYPE(lsa->header->type))
|
||||||
zlog_debug("%s Install LSA: %s age %d seqnum %x in LSDB.",
|
zlog_debug("%s Install LSA: %s age %d seqnum %x in LSDB.",
|
||||||
__PRETTY_FUNCTION__, lsa->name,
|
__func__, lsa->name, ntohs(lsa->header->age),
|
||||||
ntohs(lsa->header->age), ntohl(lsa->header->seqnum));
|
ntohl(lsa->header->seqnum));
|
||||||
|
|
||||||
/* actually install */
|
/* actually install */
|
||||||
lsa->installed = now;
|
lsa->installed = now;
|
||||||
@ -373,7 +373,7 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
|
|||||||
if (is_debug)
|
if (is_debug)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Send LSA %s (age %d) update now",
|
"%s: Send LSA %s (age %d) update now",
|
||||||
__PRETTY_FUNCTION__, lsa->name,
|
__func__, lsa->name,
|
||||||
ntohs(lsa->header->age));
|
ntohs(lsa->header->age));
|
||||||
ospf6_lsupdate_send_neighbor_now(on, lsa);
|
ospf6_lsupdate_send_neighbor_now(on, lsa);
|
||||||
continue;
|
continue;
|
||||||
@ -1004,7 +1004,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
|
|||||||
if (is_debug)
|
if (is_debug)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Current copy of LSA %s is MAXAGE, but new has recent Age.",
|
"%s: Current copy of LSA %s is MAXAGE, but new has recent Age.",
|
||||||
old->name, __PRETTY_FUNCTION__);
|
old->name, __func__);
|
||||||
|
|
||||||
ospf6_lsa_purge(old);
|
ospf6_lsa_purge(old);
|
||||||
if (new->header->adv_router
|
if (new->header->adv_router
|
||||||
|
@ -1022,8 +1022,9 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
|
|||||||
*/
|
*/
|
||||||
if (oa->intra_prefix_originate) {
|
if (oa->intra_prefix_originate) {
|
||||||
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
|
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
|
||||||
zlog_debug("%s: Re-originate intra prefix LSA, Current full nbrs %u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, oa->full_nbrs);
|
"%s: Re-originate intra prefix LSA, Current full nbrs %u",
|
||||||
|
__func__, oa->full_nbrs);
|
||||||
if (old)
|
if (old)
|
||||||
ospf6_lsa_purge_multi_ls_id(oa, old);
|
ospf6_lsa_purge_multi_ls_id(oa, old);
|
||||||
oa->intra_prefix_originate = 0;
|
oa->intra_prefix_originate = 0;
|
||||||
@ -1401,9 +1402,10 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa,
|
|||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
||||||
prefix2str(&old_route->prefix, buf,
|
prefix2str(&old_route->prefix, buf,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug("%s: route %s cost old %u new %u is not same, replace route",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s: route %s cost old %u new %u is not same, replace route",
|
||||||
o_path->cost, route->path.cost);
|
__func__, buf, o_path->cost,
|
||||||
|
route->path.cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove selected current path's nh from
|
/* Remove selected current path's nh from
|
||||||
@ -1458,10 +1460,11 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa,
|
|||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
||||||
prefix2str(&old_route->prefix, buf,
|
prefix2str(&old_route->prefix, buf,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug("%s: route %s old cost %u new cost %u, delete old entry.",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s: route %s old cost %u new cost %u, delete old entry.",
|
||||||
old_route->path.cost,
|
__func__, buf,
|
||||||
route->path.cost);
|
old_route->path.cost,
|
||||||
|
route->path.cost);
|
||||||
}
|
}
|
||||||
if (oa->route_table->hook_remove)
|
if (oa->route_table->hook_remove)
|
||||||
ospf6_route_remove(old_route,
|
ospf6_route_remove(old_route,
|
||||||
@ -1516,13 +1519,13 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa,
|
|||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s %p another path added with nh %u, effective paths %u nh %u",
|
"%s: route %s %p another path added with nh %u, effective paths %u nh %u",
|
||||||
__PRETTY_FUNCTION__, buf,
|
__func__, buf,
|
||||||
(void *)old_route,
|
(void *)old_route,
|
||||||
listcount(ecmp_path->nh_list),
|
listcount(ecmp_path->nh_list),
|
||||||
old_route->paths ?
|
old_route->paths ? listcount(
|
||||||
listcount(old_route->paths) : 0,
|
old_route->paths)
|
||||||
|
: 0,
|
||||||
listcount(old_route->nh_list));
|
listcount(old_route->nh_list));
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
list_delete_all_node(o_path->nh_list);
|
list_delete_all_node(o_path->nh_list);
|
||||||
@ -1540,9 +1543,9 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa,
|
|||||||
oa->spf_table);
|
oa->spf_table);
|
||||||
if (ls_entry == NULL) {
|
if (ls_entry == NULL) {
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX))
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX))
|
||||||
zlog_debug("%s: ls_prfix %s ls_entry not found.",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__,
|
"%s: ls_prfix %s ls_entry not found.",
|
||||||
buf);
|
__func__, buf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
lsa = ospf6_lsdb_lookup(o_path->origin.type,
|
lsa = ospf6_lsdb_lookup(o_path->origin.type,
|
||||||
@ -1559,9 +1562,9 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa,
|
|||||||
o_path->origin.id, &adv_prefix);
|
o_path->origin.id, &adv_prefix);
|
||||||
prefix2str(&adv_prefix, buf,
|
prefix2str(&adv_prefix, buf,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug("%s: adv_router %s lsa not found",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__,
|
"%s: adv_router %s lsa not found",
|
||||||
buf);
|
__func__, buf);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1587,12 +1590,13 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa,
|
|||||||
|
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
||||||
prefix2str(&route->prefix, buf, sizeof(buf));
|
prefix2str(&route->prefix, buf, sizeof(buf));
|
||||||
zlog_debug("%s: route %s %p with final effective paths %u nh%u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s: route %s %p with final effective paths %u nh%u",
|
||||||
(void *)old_route,
|
__func__, buf, (void *)old_route,
|
||||||
old_route->paths ?
|
old_route->paths
|
||||||
listcount(old_route->paths) : 0,
|
? listcount(old_route->paths)
|
||||||
listcount(old_route->nh_list));
|
: 0,
|
||||||
|
listcount(old_route->nh_list));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* used in intra_route_calculation() to add to
|
/* used in intra_route_calculation() to add to
|
||||||
@ -1636,7 +1640,7 @@ void ospf6_intra_prefix_lsa_add(struct ospf6_lsa *lsa)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX))
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX))
|
||||||
zlog_debug("%s: LSA %s found", __PRETTY_FUNCTION__, lsa->name);
|
zlog_debug("%s: LSA %s found", __func__, lsa->name);
|
||||||
|
|
||||||
oa = OSPF6_AREA(lsa->lsdb->data);
|
oa = OSPF6_AREA(lsa->lsdb->data);
|
||||||
|
|
||||||
@ -1732,21 +1736,22 @@ void ospf6_intra_prefix_lsa_add(struct ospf6_lsa *lsa)
|
|||||||
if (old) {
|
if (old) {
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
||||||
prefix2str(&route->prefix, buf, sizeof(buf));
|
prefix2str(&route->prefix, buf, sizeof(buf));
|
||||||
zlog_debug("%s Update route: %s old cost %u new cost %u paths %u nh %u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s Update route: %s old cost %u new cost %u paths %u nh %u",
|
||||||
old->path.cost, route->path.cost,
|
__func__, buf, old->path.cost,
|
||||||
listcount(route->paths),
|
route->path.cost,
|
||||||
listcount(route->nh_list));
|
listcount(route->paths),
|
||||||
|
listcount(route->nh_list));
|
||||||
}
|
}
|
||||||
ospf6_intra_prefix_route_ecmp_path(oa, old, route);
|
ospf6_intra_prefix_route_ecmp_path(oa, old, route);
|
||||||
} else {
|
} else {
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
||||||
prefix2str(&route->prefix, buf, sizeof(buf));
|
prefix2str(&route->prefix, buf, sizeof(buf));
|
||||||
zlog_debug("%s route %s add with cost %u paths %u nh %u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s route %s add with cost %u paths %u nh %u",
|
||||||
route->path.cost,
|
__func__, buf, route->path.cost,
|
||||||
listcount(route->paths),
|
listcount(route->paths),
|
||||||
listcount(route->nh_list));
|
listcount(route->nh_list));
|
||||||
}
|
}
|
||||||
ospf6_route_add(route, oa->route_table);
|
ospf6_route_add(route, oa->route_table);
|
||||||
}
|
}
|
||||||
@ -1783,7 +1788,7 @@ static void ospf6_intra_prefix_lsa_remove_update_route(struct ospf6_lsa *lsa,
|
|||||||
prefix2str(&route->prefix, buf, sizeof(buf));
|
prefix2str(&route->prefix, buf, sizeof(buf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: route %s path found with cost %u nh %u to remove.",
|
"%s: route %s path found with cost %u nh %u to remove.",
|
||||||
__PRETTY_FUNCTION__, buf, o_path->cost,
|
__func__, buf, o_path->cost,
|
||||||
listcount(o_path->nh_list));
|
listcount(o_path->nh_list));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1819,11 +1824,10 @@ static void ospf6_intra_prefix_lsa_remove_update_route(struct ospf6_lsa *lsa,
|
|||||||
|
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
||||||
prefix2str(&route->prefix, buf, sizeof(buf));
|
prefix2str(&route->prefix, buf, sizeof(buf));
|
||||||
zlog_debug("%s: route %s update paths %u nh %u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s: route %s update paths %u nh %u", __func__,
|
||||||
route->paths ? listcount(route->paths) : 0,
|
buf, route->paths ? listcount(route->paths) : 0,
|
||||||
route->nh_list ? listcount(route->nh_list)
|
route->nh_list ? listcount(route->nh_list) : 0);
|
||||||
: 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update Global Route table and
|
/* Update Global Route table and
|
||||||
@ -1859,8 +1863,7 @@ void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa)
|
|||||||
char buf[PREFIX2STR_BUFFER];
|
char buf[PREFIX2STR_BUFFER];
|
||||||
|
|
||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX))
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX))
|
||||||
zlog_debug("%s: %s disappearing", __PRETTY_FUNCTION__,
|
zlog_debug("%s: %s disappearing", __func__, lsa->name);
|
||||||
lsa->name);
|
|
||||||
|
|
||||||
oa = OSPF6_AREA(lsa->lsdb->data);
|
oa = OSPF6_AREA(lsa->lsdb->data);
|
||||||
|
|
||||||
@ -1917,12 +1920,12 @@ void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa)
|
|||||||
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
|
||||||
prefix2str(&route->prefix, buf,
|
prefix2str(&route->prefix, buf,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
zlog_debug("%s: route remove %s with path type %u cost %u paths %u nh %u",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__, buf,
|
"%s: route remove %s with path type %u cost %u paths %u nh %u",
|
||||||
route->path.type,
|
__func__, buf, route->path.type,
|
||||||
route->path.cost,
|
route->path.cost,
|
||||||
listcount(route->paths),
|
listcount(route->paths),
|
||||||
listcount(route->nh_list));
|
listcount(route->nh_list));
|
||||||
}
|
}
|
||||||
ospf6_route_remove(route, oa->route_table);
|
ospf6_route_remove(route, oa->route_table);
|
||||||
}
|
}
|
||||||
@ -2054,8 +2057,8 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
|
|||||||
|
|
||||||
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(oa->area_id) ||
|
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(oa->area_id) ||
|
||||||
IS_OSPF6_DEBUG_ROUTE(MEMORY))
|
IS_OSPF6_DEBUG_ROUTE(MEMORY))
|
||||||
zlog_info("%s: border-router calculation for area %s",
|
zlog_info("%s: border-router calculation for area %s", __func__,
|
||||||
__PRETTY_FUNCTION__, oa->name);
|
oa->name);
|
||||||
|
|
||||||
hook_add = oa->ospf6->brouter_table->hook_add;
|
hook_add = oa->ospf6->brouter_table->hook_add;
|
||||||
hook_remove = oa->ospf6->brouter_table->hook_remove;
|
hook_remove = oa->ospf6->brouter_table->hook_remove;
|
||||||
@ -2161,10 +2164,11 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
|
|||||||
|
|
||||||
if (ospf6_route_lookup(&adv_prefix, oa->spf_table)) {
|
if (ospf6_route_lookup(&adv_prefix, oa->spf_table)) {
|
||||||
if (IS_OSPF6_DEBUG_BROUTER) {
|
if (IS_OSPF6_DEBUG_BROUTER) {
|
||||||
zlog_debug("%s: keep inter brouter %s as adv router 0x%x found in spf",
|
zlog_debug(
|
||||||
__PRETTY_FUNCTION__,
|
"%s: keep inter brouter %s as adv router 0x%x found in spf",
|
||||||
brouter_name,
|
__func__, brouter_name,
|
||||||
brouter->path.origin.adv_router);
|
brouter->path.origin
|
||||||
|
.adv_router);
|
||||||
ospf6_brouter_debug_print(brouter);
|
ospf6_brouter_debug_print(brouter);
|
||||||
}
|
}
|
||||||
UNSET_FLAG(brouter->flag, OSPF6_ROUTE_REMOVE);
|
UNSET_FLAG(brouter->flag, OSPF6_ROUTE_REMOVE);
|
||||||
@ -2183,9 +2187,9 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
|
|||||||
brouter_id)
|
brouter_id)
|
||||||
|| IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(
|
|| IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(
|
||||||
oa->area_id))
|
oa->area_id))
|
||||||
zlog_info("%s: brouter %s disappears via area %s",
|
zlog_info(
|
||||||
__PRETTY_FUNCTION__, brouter_name,
|
"%s: brouter %s disappears via area %s",
|
||||||
oa->name);
|
__func__, brouter_name, oa->name);
|
||||||
/* This is used to protect nbrouter from removed from
|
/* This is used to protect nbrouter from removed from
|
||||||
* the table. For an example, ospf6_abr_examin_summary,
|
* the table. For an example, ospf6_abr_examin_summary,
|
||||||
* removes brouters which are marked for remove.
|
* removes brouters which are marked for remove.
|
||||||
@ -2201,8 +2205,7 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
|
|||||||
|| IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(
|
|| IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(
|
||||||
oa->area_id))
|
oa->area_id))
|
||||||
zlog_info("%s: brouter %s appears via area %s",
|
zlog_info("%s: brouter %s appears via area %s",
|
||||||
__PRETTY_FUNCTION__, brouter_name,
|
__func__, brouter_name, oa->name);
|
||||||
oa->name);
|
|
||||||
|
|
||||||
/* newly added */
|
/* newly added */
|
||||||
if (hook_add)
|
if (hook_add)
|
||||||
@ -2229,7 +2232,7 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
|
|||||||
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(oa->area_id) ||
|
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(oa->area_id) ||
|
||||||
IS_OSPF6_DEBUG_ROUTE(MEMORY))
|
IS_OSPF6_DEBUG_ROUTE(MEMORY))
|
||||||
zlog_info("%s: border-router calculation for area %s: done",
|
zlog_info("%s: border-router calculation for area %s: done",
|
||||||
__PRETTY_FUNCTION__, oa->name);
|
__func__, oa->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct ospf6_lsa_handler router_handler = {
|
static const struct ospf6_lsa_handler router_handler = {
|
||||||
|
@ -2186,9 +2186,8 @@ int ospf6_lsupdate_send_neighbor_now(struct ospf6_neighbor *on,
|
|||||||
|
|
||||||
if (IS_OSPF6_DEBUG_FLOODING
|
if (IS_OSPF6_DEBUG_FLOODING
|
||||||
|| IS_OSPF6_DEBUG_MESSAGE(OSPF6_MESSAGE_TYPE_LSUPDATE, SEND))
|
|| IS_OSPF6_DEBUG_MESSAGE(OSPF6_MESSAGE_TYPE_LSUPDATE, SEND))
|
||||||
zlog_debug("%s: Send lsupdate with lsa %s (age %u)",
|
zlog_debug("%s: Send lsupdate with lsa %s (age %u)", __func__,
|
||||||
__PRETTY_FUNCTION__, lsa->name,
|
lsa->name, ntohs(lsa->header->age));
|
||||||
ntohs(lsa->header->age));
|
|
||||||
|
|
||||||
ospf6_send_lsupdate(on, NULL, oh);
|
ospf6_send_lsupdate(on, NULL, oh);
|
||||||
|
|
||||||
@ -2244,8 +2243,7 @@ int ospf6_lsupdate_send_interface(struct thread *thread)
|
|||||||
if (IS_OSPF6_DEBUG_MESSAGE(
|
if (IS_OSPF6_DEBUG_MESSAGE(
|
||||||
OSPF6_MESSAGE_TYPE_LSUPDATE, SEND))
|
OSPF6_MESSAGE_TYPE_LSUPDATE, SEND))
|
||||||
zlog_debug("%s: LSUpdate length %d",
|
zlog_debug("%s: LSUpdate length %d",
|
||||||
__PRETTY_FUNCTION__,
|
__func__, ntohs(oh->length));
|
||||||
ntohs(oh->length));
|
|
||||||
|
|
||||||
memset(sendbuf, 0, iobuflen);
|
memset(sendbuf, 0, iobuflen);
|
||||||
oh = (struct ospf6_header *)sendbuf;
|
oh = (struct ospf6_header *)sendbuf;
|
||||||
|
@ -71,7 +71,7 @@ struct ospf6_prefix {
|
|||||||
#define OSPF6_PREFIX_OPTION_P (1 << 3) /* Propagate (NSSA) */
|
#define OSPF6_PREFIX_OPTION_P (1 << 3) /* Propagate (NSSA) */
|
||||||
|
|
||||||
/* caddr_t OSPF6_PREFIX_BODY (struct ospf6_prefix *); */
|
/* caddr_t OSPF6_PREFIX_BODY (struct ospf6_prefix *); */
|
||||||
#define OSPF6_PREFIX_BODY(x) ((caddr_t)(x) + sizeof (struct ospf6_prefix))
|
#define OSPF6_PREFIX_BODY(x) ((caddr_t)(x) + sizeof(struct ospf6_prefix))
|
||||||
|
|
||||||
/* size_t OSPF6_PREFIX_SPACE (int prefixlength); */
|
/* size_t OSPF6_PREFIX_SPACE (int prefixlength); */
|
||||||
#define OSPF6_PREFIX_SPACE(x) ((((x) + 31) / 32) * 4)
|
#define OSPF6_PREFIX_SPACE(x) ((((x) + 31) / 32) * 4)
|
||||||
|
@ -1356,7 +1356,7 @@ static int ospf6TrapNbrStateChange(struct ospf6_neighbor *on, int next_state,
|
|||||||
|
|
||||||
smux_trap(ospfv3_variables, array_size(ospfv3_variables),
|
smux_trap(ospfv3_variables, array_size(ospfv3_variables),
|
||||||
ospfv3_trap_oid, array_size(ospfv3_trap_oid), ospfv3_oid,
|
ospfv3_trap_oid, array_size(ospfv3_trap_oid), ospfv3_oid,
|
||||||
sizeof ospfv3_oid / sizeof(oid), index, 3, ospf6NbrTrapList,
|
sizeof(ospfv3_oid) / sizeof(oid), index, 3, ospf6NbrTrapList,
|
||||||
array_size(ospf6NbrTrapList), NBRSTATECHANGE);
|
array_size(ospf6NbrTrapList), NBRSTATECHANGE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1378,7 +1378,7 @@ static int ospf6TrapIfStateChange(struct ospf6_interface *oi, int next_state,
|
|||||||
|
|
||||||
smux_trap(ospfv3_variables, array_size(ospfv3_variables),
|
smux_trap(ospfv3_variables, array_size(ospfv3_variables),
|
||||||
ospfv3_trap_oid, array_size(ospfv3_trap_oid), ospfv3_oid,
|
ospfv3_trap_oid, array_size(ospfv3_trap_oid), ospfv3_oid,
|
||||||
sizeof ospfv3_oid / sizeof(oid), index, 2, ospf6IfTrapList,
|
sizeof(ospfv3_oid) / sizeof(oid), index, 2, ospf6IfTrapList,
|
||||||
array_size(ospf6IfTrapList), IFSTATECHANGE);
|
array_size(ospf6IfTrapList), IFSTATECHANGE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ static int ospf6_spf_install(struct ospf6_vertex *v,
|
|||||||
if (IS_OSPF6_DEBUG_SPF(PROCESS)) {
|
if (IS_OSPF6_DEBUG_SPF(PROCESS)) {
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: V lsa %s id %u, route id %u are different",
|
"%s: V lsa %s id %u, route id %u are different",
|
||||||
__PRETTY_FUNCTION__, v->lsa->name,
|
__func__, v->lsa->name,
|
||||||
ntohl(v->lsa->header->id),
|
ntohl(v->lsa->header->id),
|
||||||
ntohl(route->path.origin.id));
|
ntohl(route->path.origin.id));
|
||||||
}
|
}
|
||||||
@ -995,15 +995,15 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
|
|||||||
rtr_lsa = ospf6_lsdb_next(end, rtr_lsa);
|
rtr_lsa = ospf6_lsdb_next(end, rtr_lsa);
|
||||||
}
|
}
|
||||||
if (IS_OSPF6_DEBUG_SPF(PROCESS))
|
if (IS_OSPF6_DEBUG_SPF(PROCESS))
|
||||||
zlog_debug("%s: adv_router %s num_lsa %u to convert.",
|
zlog_debug("%s: adv_router %s num_lsa %u to convert.", __func__,
|
||||||
__PRETTY_FUNCTION__, ifbuf, num_lsa);
|
ifbuf, num_lsa);
|
||||||
if (num_lsa == 1)
|
if (num_lsa == 1)
|
||||||
return lsa;
|
return lsa;
|
||||||
|
|
||||||
if (num_lsa == 0) {
|
if (num_lsa == 0) {
|
||||||
if (IS_OSPF6_DEBUG_SPF(PROCESS))
|
if (IS_OSPF6_DEBUG_SPF(PROCESS))
|
||||||
zlog_debug("%s: adv_router %s not found in LSDB.",
|
zlog_debug("%s: adv_router %s not found in LSDB.",
|
||||||
__PRETTY_FUNCTION__, ifbuf);
|
__func__, ifbuf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1052,7 +1052,7 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
|
|||||||
inet_ntop(AF_INET, &interface_id, ifbuf, sizeof(ifbuf));
|
inet_ntop(AF_INET, &interface_id, ifbuf, sizeof(ifbuf));
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Next Router LSA %s to aggreat with len %u interface_id %s",
|
"%s: Next Router LSA %s to aggreat with len %u interface_id %s",
|
||||||
__PRETTY_FUNCTION__, rtr_lsa->name,
|
__func__, rtr_lsa->name,
|
||||||
ntohs(lsa_header->length), ifbuf);
|
ntohs(lsa_header->length), ifbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1074,9 +1074,9 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
|
|||||||
|
|
||||||
if (IS_OSPF6_DEBUG_SPF(PROCESS))
|
if (IS_OSPF6_DEBUG_SPF(PROCESS))
|
||||||
zlog_debug("%s: LSA %s id %u type 0%x len %u num_lsa %u",
|
zlog_debug("%s: LSA %s id %u type 0%x len %u num_lsa %u",
|
||||||
__PRETTY_FUNCTION__, lsa->name,
|
__func__, lsa->name, ntohl(lsa->header->id),
|
||||||
ntohl(lsa->header->id), ntohs(lsa->header->type),
|
ntohs(lsa->header->type), ntohs(lsa->header->length),
|
||||||
ntohs(lsa->header->length), num_lsa);
|
num_lsa);
|
||||||
|
|
||||||
return lsa;
|
return lsa;
|
||||||
}
|
}
|
||||||
@ -1089,7 +1089,7 @@ void ospf6_remove_temp_router_lsa(struct ospf6_area *area)
|
|||||||
if (IS_OSPF6_DEBUG_SPF(PROCESS))
|
if (IS_OSPF6_DEBUG_SPF(PROCESS))
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s Remove LSA %s lsa->lock %u lsdb count %u",
|
"%s Remove LSA %s lsa->lock %u lsdb count %u",
|
||||||
__PRETTY_FUNCTION__, lsa->name, lsa->lock,
|
__func__, lsa->name, lsa->lock,
|
||||||
area->temp_router_lsa_lsdb->count);
|
area->temp_router_lsa_lsdb->count);
|
||||||
ospf6_lsdb_remove(lsa, area->temp_router_lsa_lsdb);
|
ospf6_lsdb_remove(lsa, area->temp_router_lsa_lsdb);
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user