Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vxlan: use htonl when snooping for loopback address

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>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mike Rapoport and committed by
David S. Miller
9d9f163c c84d8055

+2 -1
+2 -1
drivers/net/vxlan.c
··· 925 925 __skb_pull(skb, skb_network_offset(skb)); 926 926 927 927 if (dst_vxlan->flags & VXLAN_F_LEARN) 928 - vxlan_snoop(skb->dev, INADDR_LOOPBACK, eth_hdr(skb)->h_source); 928 + vxlan_snoop(skb->dev, htonl(INADDR_LOOPBACK), 929 + eth_hdr(skb)->h_source); 929 930 930 931 u64_stats_update_begin(&tx_stats->syncp); 931 932 tx_stats->tx_packets++;