diff options
author | Andrey V. Elsukov <ae@FreeBSD.org> | 2017-12-16 14:36:21 +0000 |
---|---|---|
committer | Andrey V. Elsukov <ae@FreeBSD.org> | 2017-12-16 14:36:21 +0000 |
commit | 0e253fd12cb8db29ec3c3aeef5d6b2345fa6f5c7 (patch) | |
tree | a57494014a730c2951fdd12650759705ec3d10d4 /sys/net/if_vxlan.c | |
parent | e10e2b23bf89ff1400bf94abd22b9191c2a0e0e1 (diff) | |
download | src-0e253fd12cb8db29ec3c3aeef5d6b2345fa6f5c7.tar.gz src-0e253fd12cb8db29ec3c3aeef5d6b2345fa6f5c7.zip |
Fix possible memory leak.
vxlan_ftable entries are sorted in ascending order, due to wrong arguments
order it is possible to stop search before existing element will be found.
Then new element will be allocated in vxlan_ftable_update_locked() and can
be inserted in the list second time or trigger MPASS() assertion with
enabled INVARIANTS.
PR: 224371
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=326898
Diffstat (limited to 'sys/net/if_vxlan.c')
-rw-r--r-- | sys/net/if_vxlan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index c1e978648655..5c1dd5511311 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -782,7 +782,7 @@ vxlan_ftable_entry_lookup(struct vxlan_softc *sc, const uint8_t *mac) hash = VXLAN_SC_FTABLE_HASH(sc, mac); LIST_FOREACH(fe, &sc->vxl_ftable[hash], vxlfe_hash) { - dir = vxlan_ftable_addr_cmp(fe->vxlfe_mac, mac); + dir = vxlan_ftable_addr_cmp(mac, fe->vxlfe_mac); if (dir == 0) return (fe); if (dir > 0) |