1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

fixes issue #186

This commit is contained in:
Jeff Becker 2018-12-28 10:10:05 -05:00
parent 180ca69d02
commit 99ecefbdba
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
2 changed files with 10 additions and 0 deletions

View file

@ -458,6 +458,11 @@ namespace llarp
}
if(k == "ifname")
{
if(v.length() >= sizeof(m_Tun.ifname))
{
llarp::LogError(Name() + " ifname '", v, "' is too long");
return false;
}
strncpy(m_Tun.ifname, v.c_str(), sizeof(m_Tun.ifname) - 1);
llarp::LogInfo(Name(), " set ifname to ", m_Tun.ifname);
}

View file

@ -126,6 +126,11 @@ namespace llarp
}
if(k == "ifname")
{
if(v.length() >= sizeof(tunif.ifname))
{
llarp::LogError(Name() + " ifname '", v, "' is too long");
return false;
}
strncpy(tunif.ifname, v.c_str(), sizeof(tunif.ifname) - 1);
llarp::LogInfo(Name() + " setting ifname to ", tunif.ifname);
return true;