Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

2. Header compatibility fixes for environments without a recent linux/mctp.h

3. Fixed a potential array overrun when dumping netlink change events

## Added

1. `mctp-bench` now supports a "request receive" mode, where
Expand Down
4 changes: 2 additions & 2 deletions src/mctp-netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ void mctp_nl_changes_dump(mctp_nl *nl, mctp_nl_change *changes,
size_t num_changes)
{
const char *ops[MCTP_NL_OP_COUNT] = {
"ADD_LINK", "DEL_LINK", "CHANGE_NET",
"CHANGE_UP", "ADD_EID", "DEL_EID",
"ADD_LINK", "DEL_LINK", "CHANGE_NET", "CHANGE_UP",
"CHANGE_NAME", "ADD_EID", "DEL_EID",
};

fprintf(stderr, "%zu changes:\n", num_changes);
Expand Down
3 changes: 2 additions & 1 deletion src/mctp-netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct mctp_nl;
typedef struct mctp_nl mctp_nl;

struct mctp_nl_change {
#define MCTP_NL_OP_COUNT 6
#define MCTP_NL_OP_COUNT __MCTP_NL_OP_MAX
enum {
MCTP_NL_ADD_LINK,
MCTP_NL_DEL_LINK,
Expand All @@ -22,6 +22,7 @@ struct mctp_nl_change {
MCTP_NL_CHANGE_NAME,
MCTP_NL_ADD_EID,
MCTP_NL_DEL_EID,
__MCTP_NL_OP_MAX,
} op;

int ifindex;
Expand Down
2 changes: 2 additions & 0 deletions src/mctpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,8 @@ static int cb_listen_monitor(sd_event_source *s, int sd, uint32_t revents,
// 'up' state is currently unused
break;
}
default:
bug_warn("Unhandled netlink change type %d", c->op);
}
}

Expand Down