From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: roopa@cumulusnetworks.com, stephen@networkplumber.org,
davem@davemloft.net, bridge@lists.linux-foundation.org,
Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Subject: [PATCH net-next 1/4] net: bridge: minor style adjustments in br_handle_frame_finish
Date: Thu, 14 Jul 2016 06:09:59 +0300 [thread overview]
Message-ID: <1468465802-4571-2-git-send-email-nikolay@cumulusnetworks.com> (raw)
In-Reply-To: <1468465802-4571-1-git-send-email-nikolay@cumulusnetworks.com>
Trivial style changes in br_handle_frame_finish.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
net/bridge/br_input.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index a7817e6f306f..0b6d32619468 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -131,11 +131,11 @@ static void br_do_proxy_arp(struct sk_buff *skb, struct net_bridge *br,
/* note: already called with rcu_read_lock */
int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{
- const unsigned char *dest = eth_hdr(skb)->h_dest;
struct net_bridge_port *p = br_port_get_rcu(skb->dev);
- struct net_bridge *br;
- struct net_bridge_fdb_entry *dst;
+ const unsigned char *dest = eth_hdr(skb)->h_dest;
+ struct net_bridge_fdb_entry *dst = NULL;
struct net_bridge_mdb_entry *mdst;
+ struct net_bridge *br;
struct sk_buff *skb2;
bool unicast = true;
u16 vid = 0;
@@ -166,8 +166,6 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
if (br->dev->flags & IFF_PROMISC)
skb2 = skb;
- dst = NULL;
-
if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP))
br_do_proxy_arp(skb, br, vid, p);
@@ -185,13 +183,12 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
skb = NULL;
if (!skb2)
goto out;
- } else
+ } else {
skb2 = skb;
-
+ }
unicast = false;
br->dev->stats.multicast++;
- } else if ((dst = __br_fdb_get(br, dest, vid)) &&
- dst->is_local) {
+ } else if ((dst = __br_fdb_get(br, dest, vid)) && dst->is_local) {
skb2 = skb;
/* Do not forward the packet since it's local. */
skb = NULL;
@@ -201,8 +198,9 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
if (dst) {
dst->used = jiffies;
br_forward(dst->dst, skb, skb2);
- } else
+ } else {
br_flood_forward(br, skb, skb2, unicast);
+ }
}
if (skb2)
--
2.4.3
next prev parent reply other threads:[~2016-07-14 18:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 3:09 [PATCH net-next 0/4] net: bridge: simplify receive path and consolidate forwarding paths Nikolay Aleksandrov
2016-07-14 3:09 ` Nikolay Aleksandrov [this message]
2016-07-14 3:10 ` [PATCH net-next 2/4] net: bridge: rearrange flood vs unicast receive paths Nikolay Aleksandrov
2016-07-15 17:35 ` Cong Wang
2016-07-15 17:37 ` Nikolay Aleksandrov
2016-07-14 3:10 ` [PATCH net-next 3/4] net: bridge: drop skb2/skb0 variables and use a local_rcv boolean Nikolay Aleksandrov
2016-07-14 3:10 ` [PATCH net-next 4/4] net: bridge: remove _deliver functions and consolidate forward code Nikolay Aleksandrov
2016-07-17 2:58 ` [PATCH net-next 0/4] net: bridge: simplify receive path and consolidate forwarding paths David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468465802-4571-2-git-send-email-nikolay@cumulusnetworks.com \
--to=nikolay@cumulusnetworks.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).