aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2015-03-25 12:07:44 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-25 14:07:04 -0400
commitb6a7719aedd7e5c0f2df7641aa47386111682df4 (patch)
treef0374d5535a6670c1cb453cc6c0e15237e108376 /net/ipv4/ipmr.c
parent8fa38a38ac37a0ca5366cd62ba4339c2bab49db9 (diff)
ipv4: hash net ptr into fragmentation bucket selection
As namespaces are sometimes used with overlapping ip address ranges, we should also use the namespace as input to the hash to select the ip fragmentation counter bucket. Cc: Eric Dumazet <edumazet@google.com> Cc: Flavio Leitner <fbl@redhat.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 5b188832800f..c688cd1b2110 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1642,7 +1642,8 @@ static struct notifier_block ip_mr_notifier = {
1642 * important for multicast video. 1642 * important for multicast video.
1643 */ 1643 */
1644 1644
1645static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) 1645static void ip_encap(struct net *net, struct sk_buff *skb,
1646 __be32 saddr, __be32 daddr)
1646{ 1647{
1647 struct iphdr *iph; 1648 struct iphdr *iph;
1648 const struct iphdr *old_iph = ip_hdr(skb); 1649 const struct iphdr *old_iph = ip_hdr(skb);
@@ -1661,7 +1662,7 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
1661 iph->protocol = IPPROTO_IPIP; 1662 iph->protocol = IPPROTO_IPIP;
1662 iph->ihl = 5; 1663 iph->ihl = 5;
1663 iph->tot_len = htons(skb->len); 1664 iph->tot_len = htons(skb->len);
1664 ip_select_ident(skb, NULL); 1665 ip_select_ident(net, skb, NULL);
1665 ip_send_check(iph); 1666 ip_send_check(iph);
1666 1667
1667 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); 1668 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
@@ -1758,7 +1759,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
1758 * What do we do with netfilter? -- RR 1759 * What do we do with netfilter? -- RR
1759 */ 1760 */
1760 if (vif->flags & VIFF_TUNNEL) { 1761 if (vif->flags & VIFF_TUNNEL) {
1761 ip_encap(skb, vif->local, vif->remote); 1762 ip_encap(net, skb, vif->local, vif->remote);
1762 /* FIXME: extra output firewall step used to be here. --RR */ 1763 /* FIXME: extra output firewall step used to be here. --RR */
1763 vif->dev->stats.tx_packets++; 1764 vif->dev->stats.tx_packets++;
1764 vif->dev->stats.tx_bytes += skb->len; 1765 vif->dev->stats.tx_bytes += skb->len;