mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 17:50:16 +01:00
platform: assert in nm_platform_link_tun_add() for unsupported options
It doesn't make sense that NetworkManager adds non-persist tun devices, likewise, only the type IFF_TUN or IFF_TAP is supported. Assert that the values are as expected.
This commit is contained in:
parent
01ad4f33ed
commit
28b5118ad2
1 changed files with 3 additions and 2 deletions
|
|
@ -5597,8 +5597,9 @@ link_tun_add (NMPlatform *platform,
|
|||
struct ifreq ifr = { };
|
||||
nm_auto_close int fd = -1;
|
||||
|
||||
if (!NM_IN_SET (props->type, IFF_TAP, IFF_TUN))
|
||||
return FALSE;
|
||||
if ( !NM_IN_SET (props->type, IFF_TAP, IFF_TUN)
|
||||
|| !props->persist)
|
||||
g_return_val_if_reached (FALSE);
|
||||
|
||||
fd = open ("/dev/net/tun", O_RDWR | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue