aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-09-15 11:43:53 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-15 11:43:53 -0400
commitb48b63a1f6e26b0dec2c9f1690396ed4bcb66903 (patch)
tree8d9ad227c3a7d35cd78d40ecaf9bf59375dbd21a /net/core
parent7f2e6a5d8608d0353b017a0fe15502307593734e (diff)
parent3f0c3c8fe30c725c1264fb6db8cc4b69db3a658a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: net/netfilter/nfnetlink_log.c net/netfilter/xt_LOG.c Rather easy conflict resolution, the 'net' tree had bug fixes to make sure we checked if a socket is a time-wait one or not and elide the logging code if so. Whereas on the 'net-next' side we are calculating the UID and GID from the creds using different interfaces due to the user namespace changes from Eric Biederman. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c11
-rw-r--r--net/core/pktgen.c2
-rw-r--r--net/core/sock.c9
3 files changed, 15 insertions, 7 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index b1e6d6385516..dcc673d0674c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2655,15 +2655,16 @@ void __skb_get_rxhash(struct sk_buff *skb)
2655 if (!skb_flow_dissect(skb, &keys)) 2655 if (!skb_flow_dissect(skb, &keys))
2656 return; 2656 return;
2657 2657
2658 if (keys.ports) { 2658 if (keys.ports)
2659 if ((__force u16)keys.port16[1] < (__force u16)keys.port16[0])
2660 swap(keys.port16[0], keys.port16[1]);
2661 skb->l4_rxhash = 1; 2659 skb->l4_rxhash = 1;
2662 }
2663 2660
2664 /* get a consistent hash (same value on both flow directions) */ 2661 /* get a consistent hash (same value on both flow directions) */
2665 if ((__force u32)keys.dst < (__force u32)keys.src) 2662 if (((__force u32)keys.dst < (__force u32)keys.src) ||
2663 (((__force u32)keys.dst == (__force u32)keys.src) &&
2664 ((__force u16)keys.port16[1] < (__force u16)keys.port16[0]))) {
2666 swap(keys.dst, keys.src); 2665 swap(keys.dst, keys.src);
2666 swap(keys.port16[0], keys.port16[1]);
2667 }
2667 2668
2668 hash = jhash_3words((__force u32)keys.dst, 2669 hash = jhash_3words((__force u32)keys.dst,
2669 (__force u32)keys.src, 2670 (__force u32)keys.src,
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index cce9e53528b1..148e73d2c451 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2721,7 +2721,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
2721 /* Eth + IPh + UDPh + mpls */ 2721 /* Eth + IPh + UDPh + mpls */
2722 datalen = pkt_dev->cur_pkt_size - 14 - 20 - 8 - 2722 datalen = pkt_dev->cur_pkt_size - 14 - 20 - 8 -
2723 pkt_dev->pkt_overhead; 2723 pkt_dev->pkt_overhead;
2724 if (datalen < sizeof(struct pktgen_hdr)) 2724 if (datalen < 0 || datalen < sizeof(struct pktgen_hdr))
2725 datalen = sizeof(struct pktgen_hdr); 2725 datalen = sizeof(struct pktgen_hdr);
2726 2726
2727 udph->source = htons(pkt_dev->cur_udp_src); 2727 udph->source = htons(pkt_dev->cur_udp_src);
diff --git a/net/core/sock.c b/net/core/sock.c
index d765156eab65..2693f7649222 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1523,7 +1523,14 @@ EXPORT_SYMBOL(sock_rfree);
1523 1523
1524void sock_edemux(struct sk_buff *skb) 1524void sock_edemux(struct sk_buff *skb)
1525{ 1525{
1526 sock_put(skb->sk); 1526 struct sock *sk = skb->sk;
1527
1528#ifdef CONFIG_INET
1529 if (sk->sk_state == TCP_TIME_WAIT)
1530 inet_twsk_put(inet_twsk(sk));
1531 else
1532#endif
1533 sock_put(sk);
1527} 1534}
1528EXPORT_SYMBOL(sock_edemux); 1535EXPORT_SYMBOL(sock_edemux);
1529 1536