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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user