]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
devlink: Increase bus, device buffer size to 64 bytes
authorParav Pandit <parav@mellanox.com>
Thu, 6 Jun 2019 11:49:19 +0000 (06:49 -0500)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 6 Jun 2019 21:41:17 +0000 (14:41 -0700)
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>
devlink/devlink.c

index 436935f88bdae7264a595afd45e730239315b10c..559f624e366650d0decc147a45955e2fd3547a89 100644 (file)
@@ -1523,7 +1523,7 @@ static void __pr_out_handle_start(struct dl *dl, struct nlattr **tb,
 {
        const char *bus_name = mnl_attr_get_str(tb[DEVLINK_ATTR_BUS_NAME]);
        const char *dev_name = mnl_attr_get_str(tb[DEVLINK_ATTR_DEV_NAME]);
-       char buf[32];
+       char buf[64];
 
        sprintf(buf, "%s/%s", bus_name, dev_name);
 
@@ -1616,7 +1616,7 @@ static void __pr_out_port_handle_start(struct dl *dl, const char *bus_name,
                                       uint32_t port_index, bool try_nice,
                                       bool array)
 {
-       static char buf[32];
+       static char buf[64];
        char *ifname = NULL;
 
        if (dl->no_nice_names || !try_nice ||