aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-02-05 17:33:28 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-05 17:33:28 -0500
commit6e03f896b52cd2ca88942170c5c9c407ec0ede69 (patch)
tree48ca9a6efa5f99819667538838bab3679416f92c /drivers/net/tun.c
parentdb79a621835ee91d3e10177abd97f48e0a4dcf9b (diff)
parent9d82f5eb3376cbae96ad36a063a9390de1694546 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/vxlan.c drivers/vhost/net.c include/linux/if_vlan.h net/core/dev.c The net/core/dev.c conflict was the overlap of one commit marking an existing function static whilst another was adding a new function. In the include/linux/if_vlan.h case, the type used for a local variable was changed in 'net', whereas the function got rewritten to fix a stacked vlan bug in 'net-next'. In drivers/vhost/net.c, Al Viro's iov_iter conversions in 'net-next' overlapped with an endainness fix for VHOST 1.0 in 'net'. In drivers/net/vxlan.c, vxlan_find_vni() added a 'flags' parameter in 'net-next' whereas in 'net' there was a bug fix to pass in the correct network namespace pointer in calls to this function. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 3ff8cd7bf74d..ad7d3d5f3ee5 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -65,7 +65,6 @@
65#include <linux/nsproxy.h> 65#include <linux/nsproxy.h>
66#include <linux/virtio_net.h> 66#include <linux/virtio_net.h>
67#include <linux/rcupdate.h> 67#include <linux/rcupdate.h>
68#include <net/ipv6.h>
69#include <net/net_namespace.h> 68#include <net/net_namespace.h>
70#include <net/netns/generic.h> 69#include <net/netns/generic.h>
71#include <net/rtnetlink.h> 70#include <net/rtnetlink.h>
@@ -186,7 +185,7 @@ struct tun_struct {
186 struct net_device *dev; 185 struct net_device *dev;
187 netdev_features_t set_features; 186 netdev_features_t set_features;
188#define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ 187#define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \
189 NETIF_F_TSO6) 188 NETIF_F_TSO6|NETIF_F_UFO)
190 189
191 int vnet_hdr_sz; 190 int vnet_hdr_sz;
192 int sndbuf; 191 int sndbuf;
@@ -1166,8 +1165,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
1166 break; 1165 break;
1167 } 1166 }
1168 1167
1169 skb_reset_network_header(skb);
1170
1171 if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) { 1168 if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) {
1172 pr_debug("GSO!\n"); 1169 pr_debug("GSO!\n");
1173 switch (gso.gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { 1170 switch (gso.gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
@@ -1178,20 +1175,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
1178 skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; 1175 skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
1179 break; 1176 break;
1180 case VIRTIO_NET_HDR_GSO_UDP: 1177 case VIRTIO_NET_HDR_GSO_UDP:
1181 {
1182 static bool warned;
1183
1184 if (!warned) {
1185 warned = true;
1186 netdev_warn(tun->dev,
1187 "%s: using disabled UFO feature; please fix this program\n",
1188 current->comm);
1189 }
1190 skb_shinfo(skb)->gso_type = SKB_GSO_UDP; 1178 skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
1191 if (skb->protocol == htons(ETH_P_IPV6))
1192 ipv6_proxy_select_ident(skb);
1193 break; 1179 break;
1194 }
1195 default: 1180 default:
1196 tun->dev->stats.rx_frame_errors++; 1181 tun->dev->stats.rx_frame_errors++;
1197 kfree_skb(skb); 1182 kfree_skb(skb);
@@ -1220,6 +1205,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
1220 skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG; 1205 skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG;
1221 } 1206 }
1222 1207
1208 skb_reset_network_header(skb);
1223 skb_probe_transport_header(skb, 0); 1209 skb_probe_transport_header(skb, 0);
1224 1210
1225 rxhash = skb_get_hash(skb); 1211 rxhash = skb_get_hash(skb);
@@ -1297,6 +1283,8 @@ static ssize_t tun_put_user(struct tun_struct *tun,
1297 gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4; 1283 gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
1298 else if (sinfo->gso_type & SKB_GSO_TCPV6) 1284 else if (sinfo->gso_type & SKB_GSO_TCPV6)
1299 gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; 1285 gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
1286 else if (sinfo->gso_type & SKB_GSO_UDP)
1287 gso.gso_type = VIRTIO_NET_HDR_GSO_UDP;
1300 else { 1288 else {
1301 pr_err("unexpected GSO type: " 1289 pr_err("unexpected GSO type: "
1302 "0x%x, gso_size %d, hdr_len %d\n", 1290 "0x%x, gso_size %d, hdr_len %d\n",
@@ -1752,6 +1740,11 @@ static int set_offload(struct tun_struct *tun, unsigned long arg)
1752 features |= NETIF_F_TSO6; 1740 features |= NETIF_F_TSO6;
1753 arg &= ~(TUN_F_TSO4|TUN_F_TSO6); 1741 arg &= ~(TUN_F_TSO4|TUN_F_TSO6);
1754 } 1742 }
1743
1744 if (arg & TUN_F_UFO) {
1745 features |= NETIF_F_UFO;
1746 arg &= ~TUN_F_UFO;
1747 }
1755 } 1748 }
1756 1749
1757 /* This gives the user a way to test for new features in future by 1750 /* This gives the user a way to test for new features in future by