diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2013-06-11 06:41:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-12 18:07:21 -0400 |
commit | 274038f8c94c493e2977983e2aecb5f5f0778479 (patch) | |
tree | 59c639c040acb5af3eafe2a2eb7787c03dd5bfbf /drivers/net/tun.c | |
parent | 7c0cadc69ca2ac8893aa162ee80d92a805840909 (diff) |
tun: Report "persist" flag to userspace
The TUN_PERSIST flag is not reported at all -- both TUNGETIFF, and sysfs
"flags" attribute skip one. Knowing whether a device is persistent or not
is critical for checkpoint-restore, thus I propose to add the read-only
IFF_PERSIST one for this.
Setting this new IFF_PERSIST is hardly possible, as TUNSETIFF doesn't check
for unknown flags being zero and thus there can be trash.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r-- | drivers/net/tun.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 89776c592151..b90a73165d30 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1530,6 +1530,9 @@ static int tun_flags(struct tun_struct *tun) | |||
1530 | if (tun->flags & TUN_TAP_MQ) | 1530 | if (tun->flags & TUN_TAP_MQ) |
1531 | flags |= IFF_MULTI_QUEUE; | 1531 | flags |= IFF_MULTI_QUEUE; |
1532 | 1532 | ||
1533 | if (tun->flags & TUN_PERSIST) | ||
1534 | flags |= IFF_PERSIST; | ||
1535 | |||
1533 | return flags; | 1536 | return flags; |
1534 | } | 1537 | } |
1535 | 1538 | ||