netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] vxlan: use htonl when snooping for loopback address
@ 2013-04-14  9:21 Mike Rapoport
  2013-04-14 15:07 ` Cong Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mike Rapoport @ 2013-04-14  9:21 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Stephen Hemminger, Mike Rapoport

Currently "bridge fdb show dev vxlan0" lists loopback address as
"1.0.0.127". Using htonl(INADDR_LOOPBACK) rather than passing it
directly to vxlan_snoop fixes the problem.

Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
---
 drivers/net/vxlan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index ee02ecd..725aba3 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -925,7 +925,8 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan,
 	__skb_pull(skb, skb_network_offset(skb));
 
 	if (dst_vxlan->flags & VXLAN_F_LEARN)
-		vxlan_snoop(skb->dev, INADDR_LOOPBACK, eth_hdr(skb)->h_source);
+		vxlan_snoop(skb->dev, htonl(INADDR_LOOPBACK),
+			    eth_hdr(skb)->h_source);
 
 	u64_stats_update_begin(&tx_stats->syncp);
 	tx_stats->tx_packets++;
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] vxlan: use htonl when snooping for loopback address
  2013-04-14  9:21 [PATCH net-next] vxlan: use htonl when snooping for loopback address Mike Rapoport
@ 2013-04-14 15:07 ` Cong Wang
  2013-04-14 16:57 ` Stephen Hemminger
  2013-04-14 19:43 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Cong Wang @ 2013-04-14 15:07 UTC (permalink / raw)
  To: netdev

On Sun, 14 Apr 2013 at 09:21 GMT, Mike Rapoport <mike.rapoport@ravellosystems.com> wrote:
> Currently "bridge fdb show dev vxlan0" lists loopback address as
> "1.0.0.127". Using htonl(INADDR_LOOPBACK) rather than passing it
> directly to vxlan_snoop fixes the problem.
>
> Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>

Good catch!

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] vxlan: use htonl when snooping for loopback address
  2013-04-14  9:21 [PATCH net-next] vxlan: use htonl when snooping for loopback address Mike Rapoport
  2013-04-14 15:07 ` Cong Wang
@ 2013-04-14 16:57 ` Stephen Hemminger
  2013-04-14 19:43 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2013-04-14 16:57 UTC (permalink / raw)
  To: Mike Rapoport; +Cc: netdev, David S. Miller

On Sun, 14 Apr 2013 12:21:39 +0300
Mike Rapoport <mike.rapoport@ravellosystems.com> wrote:

> Currently "bridge fdb show dev vxlan0" lists loopback address as
> "1.0.0.127". Using htonl(INADDR_LOOPBACK) rather than passing it
> directly to vxlan_snoop fixes the problem.
> 
> Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
> ---
>  drivers/net/vxlan.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index ee02ecd..725aba3 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -925,7 +925,8 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan,
>  	__skb_pull(skb, skb_network_offset(skb));
>  
>  	if (dst_vxlan->flags & VXLAN_F_LEARN)
> -		vxlan_snoop(skb->dev, INADDR_LOOPBACK, eth_hdr(skb)->h_source);
> +		vxlan_snoop(skb->dev, htonl(INADDR_LOOPBACK),
> +			    eth_hdr(skb)->h_source);
>  
>  	u64_stats_update_begin(&tx_stats->syncp);
>  	tx_stats->tx_packets++;

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] vxlan: use htonl when snooping for loopback address
  2013-04-14  9:21 [PATCH net-next] vxlan: use htonl when snooping for loopback address Mike Rapoport
  2013-04-14 15:07 ` Cong Wang
  2013-04-14 16:57 ` Stephen Hemminger
@ 2013-04-14 19:43 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-04-14 19:43 UTC (permalink / raw)
  To: mike.rapoport; +Cc: netdev, stephen

From: Mike Rapoport <mike.rapoport@ravellosystems.com>
Date: Sun, 14 Apr 2013 12:21:39 +0300

> Currently "bridge fdb show dev vxlan0" lists loopback address as
> "1.0.0.127". Using htonl(INADDR_LOOPBACK) rather than passing it
> directly to vxlan_snoop fixes the problem.
> 
> Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-14 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-14  9:21 [PATCH net-next] vxlan: use htonl when snooping for loopback address Mike Rapoport
2013-04-14 15:07 ` Cong Wang
2013-04-14 16:57 ` Stephen Hemminger
2013-04-14 19:43 ` David Miller

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).