MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vxlan_socket_insert_softc

Function vxlan_socket_insert_softc

freebsd/net/if_vxlan.c:1372–1394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1370}
1371
1372static int
1373vxlan_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
1396static void
1397vxlan_socket_remove_softc(struct vxlan_socket *vso, struct vxlan_softc *sc)

Callers 1

vxlan_setup_socketFunction · 0.85

Calls 2

vxlan_releaseFunction · 0.85

Tested by

no test coverage detected