From patchwork Mon Apr 17 19:19:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chonggang Li X-Patchwork-Id: 751461 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 3w6J4f34cbz9s03 for ; Tue, 18 Apr 2017 05:20:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="j7GTxGd0"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757493AbdDQTUQ (ORCPT ); Mon, 17 Apr 2017 15:20:16 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:33997 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754147AbdDQTUN (ORCPT ); Mon, 17 Apr 2017 15:20:13 -0400 Received: by mail-pg0-f42.google.com with SMTP id z127so12484346pgb.1 for ; Mon, 17 Apr 2017 12:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bRvQ6aUvUyvW0zJEKWuYGaUxEYupzuvfMBu/nljnmaM=; b=j7GTxGd0cT5F4NPUVJchJWvI4kuqicbBhyjyUqKArXR4jIs1F0mdUEavM/r04QKYhw 3EVpTKJPslkezCkrj94V3xqatQcSqa60uHCA+2Zq6oHe6a+Wkv6/lJL+zqNbOfxh6Ufg cE0F18v24gmC1C6GWUGUxDJwPHSrvBZIFtC3udTOaOWoMEN/lMtaBAMMGHnTHoylNL2Y BrpEb3Yz1Ydfnq5wwiPDzzepPIO97c516r98zbeQn2m8SOOsw9j4P8cktCfeONwOhivr o69navll9FEfF5A60/Cp0z6EqX1nZMr6Js2dTssfcuSX4cgZWRwoCAYqijbhDl4c87CO G05A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bRvQ6aUvUyvW0zJEKWuYGaUxEYupzuvfMBu/nljnmaM=; b=cBVbDlhw9HbuyP68L4PcBajr+xibIk92JyAySsx9kiRfEY1Bi3urGjx8BhCFi7+0QL v6k0sK11XQnGZ/+Gw8LzQgJ8/+HuDVkWLEMui1nGQgxh8fMSoDz1KKurt/85kY/2TxT6 DuaR39L0ezk/7eM3BPeQFsictfRgcSi7QVo5m+jjs3JwsRDNee8SU3q2nunCbBBsnpM1 dDFSmMMId1TVespTyx2rUEvdG/aXVOKExhpMJOYk7t8EVuSIZewBcF4oAIrMA4zSfAiJ imHnCeUQ8Wk8Tt3SD9RfpCpO+F194TvDxOkJMPKq4i5zUrIq/cvxRs5wN/lol6ZZlFN1 gcUQ== X-Gm-Message-State: AN3rC/4TgGGNJySgtLJJSt7gTNE4IeRDxqxEIuwE83NmAsSHDWshNBnp VgmoE+J4q2OTaXs8 X-Received: by 10.84.222.8 with SMTP id w8mr17894708pls.103.1492456812446; Mon, 17 Apr 2017 12:20:12 -0700 (PDT) Received: from chonggangli.mtv.corp.google.com ([172.17.128.23]) by smtp.gmail.com with ESMTPSA id j125sm5024658pgc.53.2017.04.17.12.20.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Apr 2017 12:20:11 -0700 (PDT) From: Chonggang Li To: j.vosburgh@gmail.com, andy@greyhouse.net, vfalico@gmail.com, nikolay@redhat.com, edumazet@google.com, davem@davemloft.net Cc: netdev@vger.kernel.org, Chonggang Li , Mahesh Bandewar , =?UTF-8?q?Maciej=20=C5=BBenczykowski?= , Jay Vosburgh Subject: [PATCH net-next v3] bonding: deliver link-local packets with skb->dev set to link that packets arrived on Date: Mon, 17 Apr 2017 12:19:48 -0700 Message-Id: <20170417191948.89493-1-chonggangli@google.com> X-Mailer: git-send-email 2.12.2.762.g0e3151a226-goog MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Bonding driver changes the skb->dev to the bonding-master before passing the packet to stack for further processing. This, however does not make sense for the link-local packets and it loses "the link info" once its skb->dev is changed to bonding-master. This patch changes this behavior for link-local packets by not changing the skb->dev to the bonding-master and maintaining it as it is, i.e. the link on which the packet arrived. Signed-off-by: Chonggang Li Signed-off-by: Mahesh Bandewar Signed-off-by: Maciej Żenczykowski Signed-off-by: Jay Vosburgh --- Changes in v2: - Make the commit message more clearer. Changes in v3: - Fix a typo in commit message. drivers/net/bonding/bond_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 01e4a69af421..6bd3b50faf48 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1176,6 +1176,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) } } + /* don't change skb->dev for link-local packets */ + if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) + return RX_HANDLER_PASS; if (bond_should_deliver_exact_match(skb, slave, bond)) return RX_HANDLER_EXACT;