aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tun.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index a1ba262f40ad..c9e68fd76a37 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2564,6 +2564,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
2564 */ 2564 */
2565 return 0; 2565 return 0;
2566 } 2566 }
2567
2568 tun->flags = (tun->flags & ~TUN_FEATURES) |
2569 (ifr->ifr_flags & TUN_FEATURES);
2567 } 2570 }
2568 else { 2571 else {
2569 char *name; 2572 char *name;
@@ -2642,6 +2645,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
2642 ~(NETIF_F_HW_VLAN_CTAG_TX | 2645 ~(NETIF_F_HW_VLAN_CTAG_TX |
2643 NETIF_F_HW_VLAN_STAG_TX); 2646 NETIF_F_HW_VLAN_STAG_TX);
2644 2647
2648 tun->flags = (tun->flags & ~TUN_FEATURES) |
2649 (ifr->ifr_flags & TUN_FEATURES);
2650
2645 INIT_LIST_HEAD(&tun->disabled); 2651 INIT_LIST_HEAD(&tun->disabled);
2646 err = tun_attach(tun, file, false, ifr->ifr_flags & IFF_NAPI); 2652 err = tun_attach(tun, file, false, ifr->ifr_flags & IFF_NAPI);
2647 if (err < 0) 2653 if (err < 0)
@@ -2656,9 +2662,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
2656 2662
2657 tun_debug(KERN_INFO, tun, "tun_set_iff\n"); 2663 tun_debug(KERN_INFO, tun, "tun_set_iff\n");
2658 2664
2659 tun->flags = (tun->flags & ~TUN_FEATURES) |
2660 (ifr->ifr_flags & TUN_FEATURES);
2661
2662 /* Make sure persistent devices do not get stuck in 2665 /* Make sure persistent devices do not get stuck in
2663 * xoff state. 2666 * xoff state.
2664 */ 2667 */