Skip to content

Commit

Permalink
[vs] Add more logs when setting MTU on port (sonic-net#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Mar 16, 2020
1 parent c0d9947 commit 910d45e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion vslib/src/SwitchStateBaseHostif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ int SwitchStateBase::vs_set_dev_mtu(

int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);

if (sock < 0)
{
SWSS_LOG_ERROR("create socket failed: %s", strerror(errno));

return sock;
}

struct ifreq ifr;

strncpy(ifr.ifr_name, name, MAX_INTERFACE_NAME_LEN);
Expand All @@ -364,7 +371,7 @@ int SwitchStateBase::vs_set_dev_mtu(
return 0;
}

SWSS_LOG_WARN("failed to set mtu on %s to %d", name, mtu);
SWSS_LOG_WARN("failed to set mtu on %s to %d: %s", name, mtu, strerror(errno));
return err;
}

Expand Down

0 comments on commit 910d45e

Please sign in to comment.