From: Stephen Hemminger <stephen@networkplumber.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>,
"Linus Lüssing" <linus.luessing@c0d3.blue>,
"Nikolay Aleksandrov" <nikolay@cumulusnetworks.com>,
"Felix Fietkau" <nbd@nbd.name>,
bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [net-next] bridge: move maybe_deliver_addr() inside #ifdef
Date: Wed, 25 Jan 2017 16:40:48 -0800 [thread overview]
Message-ID: <20170125164048.1fc85758@xeon-e3> (raw)
In-Reply-To: <20170125222950.1352566-1-arnd@arndb.de>
On Wed, 25 Jan 2017 23:29:33 +0100
Arnd Bergmann <arnd@arndb.de> wrote:
> The only caller of this new function is inside of an #ifdef checking
> for CONFIG_BRIDGE_IGMP_SNOOPING, so we should move the implementation
> there too, in order to avoid this harmless warning:
>
> net/bridge/br_forward.c:177:13: error: 'maybe_deliver_addr' defined but not used [-Werror=unused-function]
>
> Fixes: 6db6f0eae605 ("bridge: multicast to unicast")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> net/bridge/br_forward.c | 50 ++++++++++++++++++++++++-------------------------
> 1 file changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
> index a0f9d0037d24..5a1f8ef49899 100644
> --- a/net/bridge/br_forward.c
> +++ b/net/bridge/br_forward.c
> @@ -174,31 +174,6 @@ static struct net_bridge_port *maybe_deliver(
> return p;
> }
>
> -static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb,
> - const unsigned char *addr, bool local_orig)
> -{
> - struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev;
> - const unsigned char *src = eth_hdr(skb)->h_source;
> -
> - if (!should_deliver(p, skb))
> - return;
> -
> - /* Even with hairpin, no soliloquies - prevent breaking IPv6 DAD */
> - if (skb->dev == p->dev && ether_addr_equal(src, addr))
> - return;
> -
> - skb = skb_copy(skb, GFP_ATOMIC);
> - if (!skb) {
> - dev->stats.tx_dropped++;
> - return;
> - }
> -
> - if (!is_broadcast_ether_addr(addr))
> - memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN);
> -
> - __br_forward(p, skb, local_orig);
> -}
> -
> /* called under rcu_read_lock */
> void br_flood(struct net_bridge *br, struct sk_buff *skb,
> enum br_pkt_type pkt_type, bool local_rcv, bool local_orig)
> @@ -245,6 +220,31 @@ void br_flood(struct net_bridge *br, struct sk_buff *skb,
> }
>
> #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
> +static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb,
> + const unsigned char *addr, bool local_orig)
> +{
> + struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev;
> + const unsigned char *src = eth_hdr(skb)->h_source;
> +
> + if (!should_deliver(p, skb))
> + return;
> +
> + /* Even with hairpin, no soliloquies - prevent breaking IPv6 DAD */
> + if (skb->dev == p->dev && ether_addr_equal(src, addr))
> + return;
> +
> + skb = skb_copy(skb, GFP_ATOMIC);
> + if (!skb) {
> + dev->stats.tx_dropped++;
> + return;
> + }
> +
> + if (!is_broadcast_ether_addr(addr))
> + memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN);
> +
> + __br_forward(p, skb, local_orig);
> +}
> +
> /* called with rcu_read_lock */
> void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
> struct sk_buff *skb,
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
next prev parent reply other threads:[~2017-01-26 0:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 22:29 [PATCH] [net-next] bridge: move maybe_deliver_addr() inside #ifdef Arnd Bergmann
2017-01-26 0:40 ` Stephen Hemminger [this message]
2017-01-26 4:16 ` 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=20170125164048.1fc85758@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=arnd@arndb.de \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linus.luessing@c0d3.blue \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
/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).