Better tun device name length handling.
Signed-off-by: Benjamin Cama <benoar@dolka.fr>
This commit is contained in:
parent
8f944eeb21
commit
4344f5e9c7
2 changed files with 7 additions and 3 deletions
4
l2tpns.c
4
l2tpns.c
|
|
@ -611,8 +611,8 @@ static void inittun(void)
|
|||
LOG(0, 0, 0, "Can't set tun interface: %s\n", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
assert(strlen(ifr.ifr_name) < sizeof(config->tundevice));
|
||||
strncpy(config->tundevice, ifr.ifr_name, sizeof(config->tundevice) - 1);
|
||||
assert(strlen(ifr.ifr_name) < sizeof(config->tundevice) - 1);
|
||||
strncpy(config->tundevice, ifr.ifr_name, sizeof(config->tundevice));
|
||||
|
||||
{
|
||||
// get the interface index
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue