From patchwork Sat Oct 8 05:36:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinglin Sun X-Patchwork-Id: 118409 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6EAB2B7105 for ; Sat, 8 Oct 2011 16:39:59 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751176Ab1JHFh0 (ORCPT ); Sat, 8 Oct 2011 01:37:26 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:50456 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929Ab1JHFhZ (ORCPT ); Sat, 8 Oct 2011 01:37:25 -0400 Received: by iakk32 with SMTP id k32so4975789iak.19 for ; Fri, 07 Oct 2011 22:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=p3iqqcgTTvjq/dJJMEVi4sQ8V80N4EeH6jVT1vufd3c=; b=O+zKKyu0iHrv4pEHaQFCtZ3ph1It6tKHYDjFQo6lNz3xSLJqEf8z5JxDK6KyQa0AcG LzHoM0hBLsCuwe0x0O+puEQc0b4V+ISxPlRYuKDV5YRYnV9madEklnGljcVcQDVO2f5c b94MQfaKN4gTjOuEyYC+ruAvfTvIRrL12mWkI= Received: by 10.68.34.69 with SMTP id x5mr19192324pbi.92.1318052244504; Fri, 07 Oct 2011 22:37:24 -0700 (PDT) Received: from localhost.localdomain (c-71-198-200-215.hsd1.ca.comcast.net. [71.198.200.215]) by mx.google.com with ESMTPS id i3sm38970700pbg.10.2011.10.07.22.37.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Oct 2011 22:37:23 -0700 (PDT) From: Yinglin Sun To: Jay Vosburgh , Andy Gospodarek Cc: netdev@vger.kernel.org, Yinglin Sun Subject: [PATCH] bonding: L2L3 xmit doesn't support IPv6 Date: Fri, 7 Oct 2011 22:36:45 -0700 Message-Id: <1318052205-21991-1-git-send-email-Yinglin.Sun@emc.com> X-Mailer: git-send-email 1.7.4.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add IPv6 support in L2L3 xmit policy. L3L4 doesn't support IPv6 either, and I'll try to fix that later. Signed-off-by: Yinglin Sun --- drivers/net/bonding/bond_main.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6d79b78..d6fd282 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -41,8 +41,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -3372,10 +3374,15 @@ static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count) { struct ethhdr *data = (struct ethhdr *)skb->data; struct iphdr *iph = ip_hdr(skb); + struct ipv6hdr *ipv6h = ipv6_hdr(skb); if (skb->protocol == htons(ETH_P_IP)) { return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^ (data->h_dest[5] ^ data->h_source[5])) % count; + } else if (skb->protocol == htons(ETH_P_IPV6)) { + return ((ntohl(ipv6h->saddr.s6_addr32[3] ^ + ipv6h->daddr.s6_addr32[3]) & 0xffff) ^ + (data->h_dest[5] ^ data->h_source[5])) % count; } return (data->h_dest[5] ^ data->h_source[5]) % count;