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

Function vxlan_ftable_learn

freebsd/net/if_vxlan.c:675–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675static int
676vxlan_ftable_learn(struct vxlan_softc *sc, const struct sockaddr *sa,
677 const uint8_t *mac)
678{
679 struct rm_priotracker tracker;
680 union vxlan_sockaddr vxlsa;
681 int error;
682
683 /*
684 * The source port may be randomly selected by the remote host, so
685 * use the port of the default destination address.
686 */
687 vxlan_sockaddr_copy(&vxlsa, sa);
688 vxlsa.in4.sin_port = sc->vxl_dst_addr.in4.sin_port;
689
690 if (VXLAN_SOCKADDR_IS_IPV6(&vxlsa)) {
691 error = vxlan_sockaddr_in6_embedscope(&vxlsa);
692 if (error)
693 return (error);
694 }
695
696 VXLAN_RLOCK(sc, &tracker);
697 error = vxlan_ftable_update_locked(sc, &vxlsa, mac, &tracker);
698 VXLAN_UNLOCK(sc, &tracker);
699
700 return (error);
701}
702
703static int
704vxlan_ftable_sysctl_dump(SYSCTL_HANDLER_ARGS)

Callers 1

vxlan_inputFunction · 0.85

Calls 3

vxlan_sockaddr_copyFunction · 0.85

Tested by

no test coverage detected