carp: fix source MAC

When we're not in unicast mode we need to change the source MAC address.
The check for this was wrong, because IN_MULTICAST() assumes host
endianness and the address in sc_carpaddr is in network endianness.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost
2023-03-28 00:01:37 +02:00
parent 27b23cdec9
commit ccff2078af
+1 -1
View File
@@ -1588,7 +1588,7 @@ carp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa)
switch (sa->sa_family) {
case AF_INET:
if (! IN_MULTICAST(sc->sc_carpaddr.s_addr))
if (! IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr)))
return (0);
break;
case AF_INET6: