0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Merge commit '574d7eb241a60622b0573ab1460cb23d968ba1cc' into thread-next

This commit is contained in:
Ondrej Zajicek 2024-03-28 15:00:40 +01:00
commit 62c9f12dfc
6 changed files with 15 additions and 5 deletions

View File

@ -136,6 +136,9 @@ input_help(int arg, int key UNUSED)
input_start_list();
cmd_help(rl_line_buffer, rl_point);
rl_undo_command(1, 0);
/* <cmd> ? is "internal". Do not submit command in non interactive session */
if (!interactive)
rl_replace_line("", 0);
input_stop_list();
return 0;
}

View File

@ -176,6 +176,10 @@ static inline ip6_addr ip6_not(ip6_addr a)
#define ipa_xor(x,y) ip6_xor(x,y)
#define ipa_not(x) ip6_not(x)
/* Compare addresses when zero address works like a wildcard */
static inline int ipa_equal_wildcard(ip_addr x, ip_addr y)
{ return ipa_zero(x) || ipa_zero(y) || ipa_equal(x, y); }
/*
* A zero address is either a token for invalid/unused, or the prefix of default

View File

@ -51,7 +51,8 @@ olock_same(struct object_lock *x, struct object_lock *y)
x->vrf == y->vrf &&
x->port == y->port &&
x->inst == y->inst &&
ipa_equal(x->addr, y->addr);
ipa_equal(x->addr, y->addr) &&
ipa_equal_wildcard(x->addr_local, y->addr_local);
}
static void
@ -111,7 +112,7 @@ olock_dump(resource *r, unsigned indent UNUSED)
struct object_lock *l = (struct object_lock *) r;
static char *olock_states[] = { "free", "locked", "waiting", "event" };
debug("(%d:%s:%I:%d:%d) [%s]\n", l->type, (l->iface ? l->iface->name : "?"), l->addr, l->port, l->inst, olock_states[l->state]);
debug("(%d:%s:%I:%I:%d:%d) [%s]\n", l->type, (l->iface ? l->iface->name : "?"), l->addr, l->addr_local, l->port, l->inst, olock_states[l->state]);
if (!EMPTY_LIST(l->waiters))
debug(" [wanted]\n");
}

View File

@ -26,7 +26,8 @@
struct object_lock {
resource r;
ip_addr addr; /* Identification of a object: IP address */
ip_addr addr; /* Identification of a object: IP address (strict compare) */
ip_addr addr_local; /* ... another IP address (allow zero IP wildcard) */
uint type; /* ... object type (OBJLOCK_xxx) */
uint port; /* ... port number */
uint inst; /* ... instance ID */

View File

@ -1821,6 +1821,7 @@ bgp_start(struct proto *P)
struct object_lock *lock;
lock = p->lock = olock_new(P->pool_inloop);
lock->addr = p->remote_ip;
lock->addr_local = p->cf->local_ip;
lock->port = p->cf->remote_port;
lock->iface = p->cf->iface;
lock->vrf = p->cf->iface ? NULL : p->p.vrf;

View File

@ -3354,8 +3354,8 @@ bgp_log_error(struct bgp_proto *p, u8 class, char *msg, uint code, uint subcode,
*t++ = ':';
*t++ = ' ';
if (len > 16)
len = 16;
if (len > 128)
len = 128;
for (i=0; i<len; i++)
t += bsprintf(t, "%02x", data[i]);
}