Skip to content

Commit 2cc10ce

Browse files
paravmellanoxshemminger
authored andcommitted
devlink: Increase bus, device buffer size to 64 bytes
Device name on mdev bus is 36 characters long which follow standard uuid RFC 4122. This is probably the longest name that a kernel will return for a device. Hence increase the buffer size to 64 bytes. Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
1 parent 4ae441e commit 2cc10ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

devlink/devlink.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ static void __pr_out_handle_start(struct dl *dl, struct nlattr **tb,
15231523
{
15241524
const char *bus_name = mnl_attr_get_str(tb[DEVLINK_ATTR_BUS_NAME]);
15251525
const char *dev_name = mnl_attr_get_str(tb[DEVLINK_ATTR_DEV_NAME]);
1526-
char buf[32];
1526+
char buf[64];
15271527

15281528
sprintf(buf, "%s/%s", bus_name, dev_name);
15291529

@@ -1616,7 +1616,7 @@ static void __pr_out_port_handle_start(struct dl *dl, const char *bus_name,
16161616
uint32_t port_index, bool try_nice,
16171617
bool array)
16181618
{
1619-
static char buf[32];
1619+
static char buf[64];
16201620
char *ifname = NULL;
16211621

16221622
if (dl->no_nice_names || !try_nice ||

0 commit comments

Comments
 (0)