aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/sock.c19
-rw-r--r--net/ipv4/ip_gre.c4
-rw-r--r--net/ipv4/ip_output.c1
-rw-r--r--net/ipv6/ip6_output.c1
-rw-r--r--net/ipv6/sit.c1
5 files changed, 20 insertions, 6 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 6354863b1c68..ba5d2116aea1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -939,8 +939,23 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority,
939 struct kmem_cache *slab; 939 struct kmem_cache *slab;
940 940
941 slab = prot->slab; 941 slab = prot->slab;
942 if (slab != NULL) 942 if (slab != NULL) {
943 sk = kmem_cache_alloc(slab, priority); 943 sk = kmem_cache_alloc(slab, priority & ~__GFP_ZERO);
944 if (!sk)
945 return sk;
946 if (priority & __GFP_ZERO) {
947 /*
948 * caches using SLAB_DESTROY_BY_RCU should let
949 * sk_node.next un-modified. Special care is taken
950 * when initializing object to zero.
951 */
952 if (offsetof(struct sock, sk_node.next) != 0)
953 memset(sk, 0, offsetof(struct sock, sk_node.next));
954 memset(&sk->sk_node.pprev, 0,
955 prot->obj_size - offsetof(struct sock,
956 sk_node.pprev));
957 }
958 }
944 else 959 else
945 sk = kmalloc(prot->obj_size, priority); 960 sk = kmalloc(prot->obj_size, priority);
946 961
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 44e2a3d2359a..cb4a0f4bd5e5 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -735,10 +735,10 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
735 } 735 }
736 736
737 tos = tiph->tos; 737 tos = tiph->tos;
738 if (tos&1) { 738 if (tos == 1) {
739 tos = 0;
739 if (skb->protocol == htons(ETH_P_IP)) 740 if (skb->protocol == htons(ETH_P_IP))
740 tos = old_iph->tos; 741 tos = old_iph->tos;
741 tos &= ~1;
742 } 742 }
743 743
744 { 744 {
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 247026282669..7d0821054729 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1243,7 +1243,6 @@ int ip_push_pending_frames(struct sock *sk)
1243 skb->len += tmp_skb->len; 1243 skb->len += tmp_skb->len;
1244 skb->data_len += tmp_skb->len; 1244 skb->data_len += tmp_skb->len;
1245 skb->truesize += tmp_skb->truesize; 1245 skb->truesize += tmp_skb->truesize;
1246 __sock_put(tmp_skb->sk);
1247 tmp_skb->destructor = NULL; 1246 tmp_skb->destructor = NULL;
1248 tmp_skb->sk = NULL; 1247 tmp_skb->sk = NULL;
1249 } 1248 }
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 7c76e3d18215..87f8419a68fd 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1484,7 +1484,6 @@ int ip6_push_pending_frames(struct sock *sk)
1484 skb->len += tmp_skb->len; 1484 skb->len += tmp_skb->len;
1485 skb->data_len += tmp_skb->len; 1485 skb->data_len += tmp_skb->len;
1486 skb->truesize += tmp_skb->truesize; 1486 skb->truesize += tmp_skb->truesize;
1487 __sock_put(tmp_skb->sk);
1488 tmp_skb->destructor = NULL; 1487 tmp_skb->destructor = NULL;
1489 tmp_skb->sk = NULL; 1488 tmp_skb->sk = NULL;
1490 } 1489 }
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 68e52308e552..98b7327d0949 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1018,6 +1018,7 @@ static void ipip6_tunnel_setup(struct net_device *dev)
1018 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); 1018 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr);
1019 dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr); 1019 dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr);
1020 dev->flags = IFF_NOARP; 1020 dev->flags = IFF_NOARP;
1021 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1021 dev->iflink = 0; 1022 dev->iflink = 0;
1022 dev->addr_len = 4; 1023 dev->addr_len = 4;
1023 dev->features |= NETIF_F_NETNS_LOCAL; 1024 dev->features |= NETIF_F_NETNS_LOCAL;