| 673 | } |
| 674 | |
| 675 | static int |
| 676 | vxlan_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 | |
| 703 | static int |
| 704 | vxlan_ftable_sysctl_dump(SYSCTL_HANDLER_ARGS) |
no test coverage detected