sync with OpenBSD -current

This commit is contained in:
purplerain 2024-10-02 00:06:39 +00:00
parent 665ee5434a
commit 5c45f68af5
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
20 changed files with 207 additions and 131 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: util.c,v 1.87 2024/07/03 08:39:43 job Exp $ */
/* $OpenBSD: util.c,v 1.88 2024/09/30 12:54:12 claudio Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@ -161,14 +161,16 @@ const struct ext_comm_pairs iana_ext_comms[] = IANA_EXT_COMMUNITIES;
const char *
log_ext_subtype(int type, uint8_t subtype)
{
static char etype[6];
static char etype[16];
const struct ext_comm_pairs *cp;
for (cp = iana_ext_comms; cp->subname != NULL; cp++) {
if ((type == cp->type || type == -1) && subtype == cp->subtype)
return (cp->subname);
}
snprintf(etype, sizeof(etype), "[%u]", subtype);
if (type == -1)
return ("???");
snprintf(etype, sizeof(etype), "[%hhx:%hhx]", (uint8_t)type, subtype);
return (etype);
}