aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2023-03-27 22:01:37 +0000
committerKristof Provost <kp@FreeBSD.org>2023-03-27 23:18:18 +0000
commitccff2078af42dc066e1c38d25fcb83d960c3c22b (patch)
tree0c5245434bae76bb163e644ac31624ac7a6cb1a6
parent27b23cdec9d1255e014ea0decac42a5be8d00735 (diff)
downloadsrc-main.tar.gz
src-main.zip
carp: fix source MACHEADmain
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")
-rw-r--r--sys/netinet/ip_carp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index deb2f3f347d9..2e1c8e084b4b 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -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: