aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
Commit message (Collapse)AuthorAge
* vxlan: fix igmp racesstephen hemminger2013-07-19
| | | | | | | | | | | | | | | There are two race conditions in existing code for doing IGMP management in workqueue in vxlan. First, the vxlan_group_used function checks the list of vxlan's without any protection, and it is possible for open followed by close to occur before the igmp work queue runs. To solve these move the check into vxlan_open/stop so it is protected by RTNL. And split into two work structures so that there is no racy reference to underlying device state. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: unregister on namespace exitstephen hemminger2013-07-19
| | | | | | | | | | Fix memory leaks and other badness from VXLAN network namespace teardown. When network namespace is removed, all the vxlan devices should be unregistered (not closed). Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: add necessary locking on device removalstephen hemminger2013-07-17
| | | | | | | | | | | The socket management is now done in workqueue (outside of RTNL) and protected by vn->sock_lock. There were two possible bugs, first the vxlan device was removed from the VNI hash table per socket without holding lock. And there was a race when device is created and the workqueue could run after deletion. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: Fix kernel crash on rmmod.Pravin B Shelar2013-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vxlan exit module unregisters vxlan net and then it unregisters rtnl ops which triggers vxlan_dellink() from __rtnl_kill_links(). vxlan_dellink() deletes vxlan-dev from vxlan_list which has list-head in vxlan-net-struct but that is already gone due to net-unregister. That is how we are getting following crash. Following commit fixes the crash by fixing module exit path. BUG: unable to handle kernel paging request at ffff8804102c8000 IP: [<ffffffff812cc5e9>] __list_del_entry+0x29/0xd0 PGD 2972067 PUD 83e019067 PMD 83df97067 PTE 80000004102c8060 Oops: 0000 [#1] SMP DEBUG_PAGEALLOC Modules linked in: --- CPU: 19 PID: 6712 Comm: rmmod Tainted: GF 3.10.0+ #95 Hardware name: Dell Inc. PowerEdge R620/0KCKR5, BIOS 1.4.8 10/25/2012 task: ffff88080c47c580 ti: ffff88080ac50000 task.ti: ffff88080ac50000 RIP: 0010:[<ffffffff812cc5e9>] [<ffffffff812cc5e9>] __list_del_entry+0x29/0xd0 RSP: 0018:ffff88080ac51e08 EFLAGS: 00010206 RAX: ffff8804102c8000 RBX: ffff88040f0d4b10 RCX: dead000000200200 RDX: ffff8804102c8000 RSI: ffff88080ac51e58 RDI: ffff88040f0d4b10 RBP: ffff88080ac51e08 R08: 0000000000000001 R09: 2222222222222222 R10: 2222222222222222 R11: 2222222222222222 R12: ffff88080ac51e58 R13: ffffffffa07b8840 R14: ffffffff81ae48c0 R15: ffff88080ac51e58 FS: 00007f9ef105c700(0000) GS:ffff88082a800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff8804102c8000 CR3: 00000008227e5000 CR4: 00000000000407e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Stack: ffff88080ac51e28 ffffffff812cc6a1 2222222222222222 ffff88040f0d4000 ffff88080ac51e48 ffffffffa07b3311 ffff88040f0d4000 ffffffff81ae49c8 ffff88080ac51e98 ffffffff81492fc2 ffff88080ac51e58 ffff88080ac51e58 Call Trace: [<ffffffff812cc6a1>] list_del+0x11/0x40 [<ffffffffa07b3311>] vxlan_dellink+0x51/0x70 [vxlan] [<ffffffff81492fc2>] __rtnl_link_unregister+0xa2/0xb0 [<ffffffff8149448e>] rtnl_link_unregister+0x1e/0x30 [<ffffffffa07b7b7c>] vxlan_cleanup_module+0x1c/0x2f [vxlan] [<ffffffff810c9b31>] SyS_delete_module+0x1d1/0x2c0 [<ffffffff812b8a0e>] ? trace_hardirqs_on_thunk+0x3a/0x3f [<ffffffff81582f42>] system_call_fastpath+0x16/0x1b Code: eb 9f 55 48 8b 17 48 b9 00 01 10 00 00 00 ad de 48 8b 47 08 48 89 e5 48 39 ca 74 29 48 b9 00 02 20 00 00 00 ad de 48 39 c8 74 7a <4c> 8b 00 4c 39 c7 75 53 4c 8b 42 08 4c 39 c7 75 2b 48 89 42 08 RIP [<ffffffff812cc5e9>] __list_del_entry+0x29/0xd0 RSP <ffff88080ac51e08> CR2: ffff8804102c8000 Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: fix function name spellingStephen Hemminger2013-06-25
| | | | Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: fdb: allow specifying multiple destinations for zero MACMike Rapoport2013-06-25
| | | | | | | | | | The zero MAC entry in the fdb is used as default destination. With multiple default destinations it is possible to use vxlan in environments that disable multicast on the infrastructure level, e.g. public clouds. Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: allow removal of single destination from fdb entryMike Rapoport2013-06-25
| | | | | | | | When the last item is deleted from the remote destinations list, the fdb entry is destroyed. Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: introduce vxlan_fdb_parseMike Rapoport2013-06-25
| | | | | | | which will be reused by vxlan_fdb_delete Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: introduce vxlan_fdb_find_rdstMike Rapoport2013-06-25
| | | | | | | which will be reused by vxlan_fdb_delete Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: add implicit fdb entry for default destinationMike Rapoport2013-06-25
| | | | | Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: Fix sparse warnings.Pravin B Shelar2013-06-25
| | | | | | | | | | | | | Fix following sparse warnings. drivers/net/vxlan.c:238:44: warning: incorrect type in argument 3 (different base types) drivers/net/vxlan.c:238:44: expected restricted __be32 [usertype] value drivers/net/vxlan.c:238:44: got unsigned int const [unsigned] [usertype] remote_vni drivers/net/vxlan.c:1735:18: warning: incorrect type in initializer (different signedness) drivers/net/vxlan.c:1735:18: expected int *id drivers/net/vxlan.c:1735:18: got unsigned int static [toplevel] *<noident> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: cosmetic cleanup'sStephen Hemminger2013-06-24
| | | | | | | Fix whitespace and spelling Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David L Stevens <dlstevens@us.ibm.com>
* vxlan: Use initializer for dummy structuresStephen Hemminger2013-06-24
| | | | | | | For the notification code, a couple of places build fdb entries on the stack, use structure initialization instead and fix formatting. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: port module param should be ushortStephen Hemminger2013-06-24
| | | | | | UDP ports are limited to 16 bits. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: convert remotes list to list_rcuStephen Hemminger2013-06-24
| | | | | | | | | | Based on initial work by Mike Rapoport <mike.rapoport@ravellosystems.com> Use list macros and RCU for tracking multiple remotes. Note: this code assumes list always has at least one entry, because delete is not supported. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: make vxlan_xmit_one voidStephen Hemminger2013-06-24
| | | | | | | | The function vxlan_xmit_one always returns NETDEV_TX_OK, so there is no point in keeping track of return values etc. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David L Stevens <dlstevens@us.ibm.com>
* vxlan: move cleanup to uninitStephen Hemminger2013-06-24
| | | | | | | | | Put destruction of per-cpu statistics removal in ndo_uninit since it is created by ndo_init. This also avoids any problems that might be cause by destructor being called after module removed. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: fix race caused by dropping rtnl_unlockStephen Hemminger2013-06-24
| | | | | | | | | | | | | | | It is possible for two cpu's to race creating vxlan device. For most cases this is harmless, but the ability to assign "next avaliable vxlan device" relies on rtnl lock being held across the whole operation. Therfore two instances of calling: ip li add vxlan%d vxlan ... could collide and create two devices with same name. To fix this defer creation of socket to a work queue, and handle possible races there. Introduce a lock to ensure that changes to vxlan socket hash list is SMP safe. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: send notification when MAC migratesStephen Hemminger2013-06-24
| | | | | | | When learned entry migrates to another IP send a notification that entry has changed. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: move IGMP join/leave to work queueStephen Hemminger2013-06-24
| | | | | | | | | | | | Do join/leave from work queue to avoid lock inversion problems between normal socket and RTNL. The code comes out cleaner as well. Uses Cong Wang's suggestion to turn refcnt into a real atomic since now need to handle case where last use of socket is IGMP worker. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: fix crash from work pending on module removalStephen Hemminger2013-06-24
| | | | | | | Switch to using a per module work queue so that all the socket deletion callbacks are done when module is removed. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* vxlan: fix out of order operation on module removalStephen Hemminger2013-06-24
| | | | | | | | If vxlan is removed with active vxlan's it would crash because rtnl_link_unregister (which calls vxlan_dellink), was invoked before unregister_pernet_device (which calls vxlan_stop). Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* ip_tunnels: extend iptunnel_xmit()Pravin B Shelar2013-06-19
| | | | | | | | Refactor various ip tunnels xmit functions and extend iptunnel_xmit() so that there is more code sharing. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2013-06-19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/wireless/ath/ath9k/Kconfig drivers/net/xen-netback/netback.c net/batman-adv/bat_iv_ogm.c net/wireless/nl80211.c The ath9k Kconfig conflict was a change of a Kconfig option name right next to the deletion of another option. The xen-netback conflict was overlapping changes involving the handling of the notify list in xen_netbk_rx_action(). Batman conflict resolution provided by Antonio Quartulli, basically keep everything in both conflict hunks. The nl80211 conflict is a little more involved. In 'net' we added a dynamic memory allocation to nl80211_dump_wiphy() to fix a race that Linus reported. Meanwhile in 'net-next' the handlers were converted to use pre and post doit handlers which use a flag to determine whether to hold the RTNL mutex around the operation. However, the dump handlers to not use this logic. Instead they have to explicitly do the locking. There were apparent bugs in the conversion of nl80211_dump_wiphy() in that we were not dropping the RTNL mutex in all the return paths, and it seems we very much should be doing so. So I fixed that whilst handling the overlapping changes. To simplify the initial returns, I take the RTNL mutex after we try to allocate 'tb'. Signed-off-by: David S. Miller <davem@davemloft.net>
| * vxlan: fix check for migration of static entrystephen hemminger2013-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check introduced by: commit 26a41ae604381c5cc0caf1c3261ca6b298b5fe69 Author: stephen hemminger <stephen@networkplumber.org> Date: Mon Jun 17 12:09:58 2013 -0700 vxlan: only migrate dynamic FDB entries was not correct because it is checking flag about type of FDB entry, rather than the state (dynamic versus static). The confusion arises because vxlan is reusing values from bridge, and bridge is reusing values from neighbour table, and easy to get lost in translation. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
| * vxlan: handle skb_clone failurestephen hemminger2013-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If skb_clone fails if out of memory then just skip the fanout. Problem was introduced in 3.10 with: commit 6681712d67eef14c4ce793561c3231659153a320 Author: David Stevens <dlstevens@us.ibm.com> Date: Fri Mar 15 04:35:51 2013 +0000 vxlan: generalize forwarding tables Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
| * vxlan: only migrate dynamic FDB entriesstephen hemminger2013-06-17
| | | | | | | | | | | | | | | | | | | | | | | | Only migrate dynamic forwarding table entries, don't modify static entries. If packet received from incorrect source IP address assume it is an imposter and drop it. This patch applies only to -net, a different patch would be needed for earlier kernels since the NTF_SELF flag was introduced with 3.10. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
| * vxlan: fix race between flush and incoming learningstephen hemminger2013-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible for a packet to arrive during vxlan_stop(), and have a dynamic entry created. Close this by checking if device is up. CPU1 CPU2 vxlan_stop vxlan_flush hash_lock acquired vxlan_encap_recv vxlan_snoop waiting for hash_lock hash_lock relased vxlan_flush done hash_lock acquired vxlan_fdb_create This is a day-one bug in vxlan goes back to 3.7. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | vxlan: defer vxlan init as late as possibleCong Wang2013-05-29
| | | | | | | | | | | | | | | | | | | | | | When vxlan is compiled as builtin, its init code runs before IPv6 init, this could cause problems if we create IPv6 socket in the latter patch. Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | vxlan: use unsigned int instead of unsignedCong Wang2013-05-29
| | | | | | | | | | | | | | | | | | 'unsigned int' is slightly better. Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | vxlan: remove the unused rcu head from struct vxlan_rdstCong Wang2013-05-29
| | | | | | | | | | | | | | | | Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2013-05-24
|\| | | | | | | | | | | | | Merge net into net-next because some upcoming net-next changes build on top of bug fixes that went into net. Signed-off-by: David S. Miller <davem@davemloft.net>
| * vxlan: Update vxlan fdb 'used' field after each usageSridhar Samudrala2013-05-18
| | | | | | | | | | | | | | | | | | | | | | Fix some instances where vxlan fdb 'used' field is not updated after the entry is used. v2: rename vxlan_find_mac() as __vxlan_find_mac() and create a new vxlan_find_mac() that also updates ->used field. Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | vxlan: listen on multiple portsstephen hemminger2013-05-17
|/ | | | | | | | | | | | | | | | | | | | | | The commit 823aa873bc782f1c51b1ce8ec6da7cfcaf93836e Author: stephen hemminger <stephen@networkplumber.org> Date: Sat Apr 27 11:31:57 2013 +0000 vxlan: allow choosing destination port per vxlan introduced per-vxlan UDP port configuration but only did half of the necessary work. It added per vxlan destination for sending, but overlooked the handling of multiple ports for incoming traffic. This patch changes the listening port management to handle multiple incoming UDP ports. The earlier per-namespace structure is now a hash list per namespace. It is also now possible to define the same virtual network id but with different UDP port values which can be useful for migration. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: do not set SKB_GSO_UDPDmitry Kravkov2013-04-29
| | | | | | | | | | | Since SKB_GSO_* flags are set by appropriate gso_segment callback in TCP/UDP layer. CC: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: allow choosing destination port per vxlanstephen hemminger2013-04-29
| | | | | | | | | Allow configuring the default destination port on a per-device basis. Adds new netlink paramater IFLA_VXLAN_PORT to allow setting destination port when creating new vxlan. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: compute source port in network byte orderstephen hemminger2013-04-29
| | | | | | | | | Rather than computing source port and returning it in host order then swapping later, go ahead and compute it in network order to start with. Cleaner and less error prone. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: source compatiablity with IFLA_VXLAN_GROUP (v2)stephen hemminger2013-04-29
| | | | | | | | | | | | | | Source compatiability for build iproute2 was broken by: commit c7995c43facc6e5dea4de63fa9d283a337aabeb1 Author: Atzm Watanabe <atzm@stratosphere.co.jp> vxlan: Allow setting destination to unicast address. Since this commit has not made it upstream (still net-next), and better to avoid gratitious changes to exported API's; go back to original definition, and add a comment. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: fix byte order issues with NDA_PORTstephen hemminger2013-04-29
| | | | | | | | | | | | The NDA_PORT attribute was added, but the author wasn't careful about width (port is 16 bits), or byte order. The attribute was being dumped as 16 bits, but only 32 bit value would be accepted when setting up a device. Also, the remote port is in network byte order and was being compared with default port in host byte order. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: document UDP default portstephen hemminger2013-04-29
| | | | | | | | The default port for VXLAN is not same as IANA value. Document this. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: update mail address and copyright datestephen hemminger2013-04-29
| | | | | Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* VXLAN: Allow L2 redirection with L3 switchingDavid Stevens2013-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allow L2 redirection when VXLAN L3 switching is enabled This patch restricts L3 switching to destination MAC addresses that are marked as routers in order to allow virtual IP appliances that do L2 redirection to function with VXLAN L3 switching enabled. We use L3 switching on VXLAN networks to avoid extra hops when the nominal router for cross-subnet traffic for a VM is remote and the ultimate destination may be local, or closer to the local node. Currently, the destination IP address takes precedence over the MAC address in all cases. Some network appliances receive packets for a virtualized IP address and redirect by changing the destination MAC address (only) to be the final destination for packet processing. VXLAN tunnel endpoints with L3 switching enabled may then overwrite this destination MAC address based on the packet IP address, resulting in potential loops and, at least, breaking L2 redirections that travel through tunnel endpoints. This patch limits L3 switching to the intended case where the original destination MAC address is a next-hop router and relies on the destination MAC address for all other cases, thus allowing L2 redirection and L3 switching to coexist peacefully. Signed-Off-By: David L Stevens <dlstevens@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: Allow setting destination to unicast address.Atzm Watanabe2013-04-16
| | | | | | | | | | | | | | | | | | | | This patch allows setting VXLAN destination to unicast address. It allows that VXLAN can be used as peer-to-peer tunnel without multicast. v4: generalize struct vxlan_dev, "gaddr" is replaced with vxlan_rdst. "GROUP" attribute is replaced with "REMOTE". they are based by David Stevens's comments. v3: move a new attribute REMOTE into the last of an enum list based by Stephen Hemminger's comments. v2: use a new attribute REMOTE instead of GROUP based by Cong Wang's comments. Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp> Acked-by: David L Stevens <dlstevens@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: don't bypass encapsulation for multi- and broadcastsMike Rapoport2013-04-15
| | | | | | | | | | | | | | The multicast and broadcast packets may have RTCF_LOCAL set in rt_flags and therefore will be sent out bypassing encapsulation. This breaks delivery of packets sent to the vxlan multicast group. Disabling encapsulation bypass for multicasts and broadcasts fixes the issue. Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com> Tested-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Sridhar Samudrala <sri@us.ibm.com> Tested-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: use htonl when snooping for loopback addressMike Rapoport2013-04-14
| | | | | | | | | | | 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>
* vxlan: fix some sparse warningsWei Yongjun2013-04-12
| | | | | | | | | Fixes following warning: drivers/net/vxlan.c:406:6: warning: symbol 'vxlan_fdb_free' was not declared. Should it be static? drivers/net/vxlan.c:1111:37: warning: Using plain integer as NULL pointer Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
* vxlan: Bypass encapsulation if the destination is localSridhar Samudrala2013-04-07
| | | | | | | | | | This patch bypasses vxlan encapsulation if the destination vxlan endpoint is a local device. Changes since v1: added missing check for vxlan_find_vni() failure Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* VXLAN: Fix sparse warnings.Pravin B Shelar2013-03-27
| | | | | | | | | | | | Fixes following warning:- drivers/net/vxlan.c:471:35: warning: symbol 'dev' shadows an earlier one drivers/net/vxlan.c:433:26: originally declared here drivers/net/vxlan.c:794:34: warning: symbol 'vxlan' shadows an earlier one drivers/net/vxlan.c:757:26: originally declared here CC: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* VXLAN: Use IP Tunnels tunnel ENC encap APIPravin B Shelar2013-03-26
| | | | | | | | Use common ecn_encap functions from ip_tunnel module. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* VXLAN: Fix vxlan stats handling.Pravin B Shelar2013-03-26
| | | | | | | | | | | | | | | Fixes bug in VXLAN code where is iptunnel_xmit() called with NULL dev->tstats. This bug was introduced in commit 6aed0c8bf7d2f389b (tunnel: use iptunnel_xmit() again). Following patch fixes bug by setting dev->tstats. It uses ip_tunnel module code to share stats function. CC: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>