Skip to content

Commit

Permalink
carp: fix byte order for IN_MULTICAST checks
Browse files Browse the repository at this point in the history
PR: #239
  • Loading branch information
fichtner committed Feb 18, 2025
1 parent cc31625 commit 8f86d0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/netinet/ip_carp.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl)
sc = ifa->ifa_carp;
CARP_LOCK(sc);
if (ifa->ifa_addr->sa_family == AF_INET) {
multicast = IN_MULTICAST(sc->sc_carpaddr.s_addr);
multicast = IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr));
} else {
multicast = IN6_IS_ADDR_MULTICAST(&sc->sc_carpaddr6);
}
Expand Down Expand Up @@ -988,7 +988,7 @@ carp_send_ad_locked(struct carp_softc *sc)
m->m_pkthdr.rcvif = NULL;
m->m_len = len;
M_ALIGN(m, m->m_len);
if (IN_MULTICAST(sc->sc_carpaddr.s_addr))
if (IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr)))
m->m_flags |= M_MCAST;
ip = mtod(m, struct ip *);
ip->ip_v = IPVERSION;
Expand Down

0 comments on commit 8f86d0f

Please sign in to comment.