Skip to content

Commit

Permalink
Format truncation fix
Browse files Browse the repository at this point in the history
Interface identifier is effectively singed 32bit integer.

Relates #169
  • Loading branch information
GeorgyKirichenko committed May 4, 2024
1 parent 5bc653e commit 9c9f62e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dataplane/neighbor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ static void parse_rt_attributes(rtattr* rt_attributes[],
}
}

static std::string iface_id_to_name(unsigned int iface_id)
static std::string iface_id_to_name(int32_t iface_id)
{
char buffer[IFNAMSIZ];
if (if_indextoname(iface_id, buffer) == nullptr)
{
snprintf(buffer, IFNAMSIZ, "unknown_%u", iface_id);
snprintf(buffer, IFNAMSIZ, "unknown_%i", iface_id);
}
return buffer;
}
Expand Down

0 comments on commit 9c9f62e

Please sign in to comment.