* ifaddr_event handler. * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent * source address spoofing. */
| 808 | * source address spoofing. |
| 809 | */ |
| 810 | static void |
| 811 | ipsec_srcaddr(void *arg __unused, const struct sockaddr *sa, |
| 812 | int event __unused) |
| 813 | { |
| 814 | struct ipsec_softc *sc; |
| 815 | struct secasindex *saidx; |
| 816 | |
| 817 | /* Check that VNET is ready */ |
| 818 | if (V_ipsec_idhtbl == NULL) |
| 819 | return; |
| 820 | |
| 821 | NET_EPOCH_ASSERT(); |
| 822 | CK_LIST_FOREACH(sc, ipsec_srchash(sa), srchash) { |
| 823 | if (sc->family == 0) |
| 824 | continue; |
| 825 | saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sa->sa_family); |
| 826 | if (saidx == NULL || |
| 827 | key_sockaddrcmp(&saidx->src.sa, sa, 0) != 0) |
| 828 | continue; |
| 829 | ipsec_set_running(sc); |
| 830 | } |
| 831 | } |
| 832 | |
| 833 | /* |
| 834 | * Allocate new private security policies for tunneling interface. |
nothing calls this directly
no test coverage detected