- Loop back detection.
This PR reverts 310847 (first half).
For loop back detection now used counter field of CARP packet, that was in CARP to resist replay packets.
Check is simple now: carp_counter from packet compares with carp_counter last send packet.
- Add counter for loop back detection.
- CARP packets with VHID = 0 now dropped as "invalid VHID" before any other checks.
- carp_version != CARP_VERSION || ch->carp_authlen != CARP_AUTHLEN - now is second check.
- Add definition for CARP_AUTHLEN.
- Removed sc_init_counter, that fix carp_counter - it always generate from random.
- Add carps_badif and carps_dups to netstat.
- Few micro changes:
sizeof(sc->sc_counter) -> (sizeof(uint32_t) * 2) snprintf(subsys, IFNAMSIZ+5, -> snprintf(subsys, sizeof(subsys),
PS: also I see that:
/* check if received on a valid carp interface */ if (m->m_pkthdr.rcvif->if_carp == NULL) { CARPSTATS_INC(carps_badif); CARP_DEBUG("%s: packet received on non-carp interface: %s\n", __func__, m->m_pkthdr.rcvif->if_xname); m_freem(m); return (IPPROTO_DONE); }
only in carp6_input(), probably carp_input() need this check too.