| 1370 | } |
| 1371 | |
| 1372 | static int |
| 1373 | vxlan_socket_insert_softc(struct vxlan_socket *vso, struct vxlan_softc *sc) |
| 1374 | { |
| 1375 | struct vxlan_softc *tsc; |
| 1376 | uint32_t vni, hash; |
| 1377 | |
| 1378 | vni = sc->vxl_vni; |
| 1379 | hash = VXLAN_SO_VNI_HASH(vni); |
| 1380 | |
| 1381 | VXLAN_SO_WLOCK(vso); |
| 1382 | tsc = vxlan_socket_lookup_softc_locked(vso, vni); |
| 1383 | if (tsc != NULL) { |
| 1384 | VXLAN_SO_WUNLOCK(vso); |
| 1385 | vxlan_release(tsc); |
| 1386 | return (EEXIST); |
| 1387 | } |
| 1388 | |
| 1389 | VXLAN_ACQUIRE(sc); |
| 1390 | LIST_INSERT_HEAD(&vso->vxlso_vni_hash[hash], sc, vxl_entry); |
| 1391 | VXLAN_SO_WUNLOCK(vso); |
| 1392 | |
| 1393 | return (0); |
| 1394 | } |
| 1395 | |
| 1396 | static void |
| 1397 | vxlan_socket_remove_softc(struct vxlan_socket *vso, struct vxlan_softc *sc) |
no test coverage detected