Skip to content

Commit

Permalink
Merge branch 'pr/address-formatting'
Browse files Browse the repository at this point in the history
  • Loading branch information
jk-ozlabs committed Oct 21, 2024
2 parents 7ad6641 + 8245256 commit 393f41a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
interface default (normally the maximum MTU).
The .SetMTU method can be used to set the endpoint route MTU.

3. Hardware address formatting has been improved in cases where the address
size is something other than a 1-byte value.

## [2.0] - 2024-09-19

### Added
Expand Down
8 changes: 6 additions & 2 deletions src/mctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,16 @@ static int display_ifinfo(struct ctx *ctx, void *p, size_t len) {
updown = msg->ifi_flags & IFF_UP ? "up" : "down";
// not sure if will be NULL terminated, handle either
name_len = strnlen(name, name_len);
printf("dev %*s index %d address 0x",
printf("dev %*s index %d address ",
(int)name_len, name, msg->ifi_index);
if (addr_len == 1) {
// make it clear that it is hex not decimal
printf("0x");
}
if (addr && addr_len)
print_hex_addr(addr, addr_len);
else
printf("(no-addr)");
printf("none");
printf(" net %d mtu %d %s\n", net, mtu, updown);
return 0;
}
Expand Down

0 comments on commit 393f41a

Please sign in to comment.