netinet: rename in_broadcast() to in_ifnet_broadcast()

This aligns with existing in_ifaddr_broadcast() and aligns with other
simple functions or macros with bare "in_" prefix that operator just on
struct in_addr and nothing else, e.g. in_nullhost().  No functional
change.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D49041
This commit is contained in:
Gleb Smirnoff 2025-02-21 18:10:53 -08:00
parent 4b79443927
commit 197fc4cad0
7 changed files with 9 additions and 9 deletions

View file

@ -1293,7 +1293,7 @@ in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia)
* Return true if the address might be a local broadcast address.
*/
bool
in_broadcast(struct in_addr in, struct ifnet *ifp)
in_ifnet_broadcast(struct in_addr in, struct ifnet *ifp)
{
struct ifaddr *ifa;

View file

@ -672,7 +672,7 @@ int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t,
struct ifnet; struct mbuf; /* forward declarations for Standard C */
struct in_ifaddr;
bool in_broadcast(struct in_addr, struct ifnet *);
bool in_ifnet_broadcast(struct in_addr, struct ifnet *);
bool in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *);
int in_canforward(struct in_addr);
int in_localaddr(struct in_addr);

View file

@ -71,7 +71,7 @@ rib4_set_nh_pfxflags(u_int fibnum, const struct sockaddr *addr, const struct soc
* add these routes to support some cases with active-active
* load balancing. Given that, retain this support.
*/
if (in_broadcast(addr4->sin_addr, nh->nh_ifp))
if (in_ifnet_broadcast(addr4->sin_addr, nh->nh_ifp))
is_broadcast = true;
} else if (mask4->sin_addr.s_addr == 0)
nhop_set_pxtype_flag(nh, NHF_DEFAULT);

View file

@ -538,7 +538,7 @@ div_output_inbound(int family, struct socket *so, struct mbuf *m,
*/
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)))
m->m_flags |= M_MCAST;
else if (in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif))
else if (in_ifnet_broadcast(ip->ip_dst, m->m_pkthdr.rcvif))
m->m_flags |= M_BCAST;
netisr_queue_src(NETISR_IP, (uintptr_t)so, m);
DIVSTAT_INC(inbound);

View file

@ -342,7 +342,7 @@ typedef struct callout sctp_os_timer_t;
} while(0)
/* Other m_pkthdr type things */
#define SCTP_IS_IT_BROADCAST(dst, m) ((m->m_flags & M_PKTHDR) ? in_broadcast(dst, m->m_pkthdr.rcvif) : 0)
#define SCTP_IS_IT_BROADCAST(dst, m) ((m->m_flags & M_PKTHDR) ? in_ifnet_broadcast(dst, m->m_pkthdr.rcvif) : 0)
#define SCTP_IS_IT_LOOPBACK(m) ((m->m_flags & M_PKTHDR) && ((m->m_pkthdr.rcvif == NULL) || (m->m_pkthdr.rcvif->if_type == IFT_LOOP)))
/* This converts any input packet header

View file

@ -1290,7 +1290,7 @@ tfo_socket_result:
* global or subnet broad- or multicast address.
* Note that it is quite possible to receive unicast
* link-layer packets with a broadcast IP address. Use
* in_broadcast() to find them.
* in_ifnet_broadcast() to find them.
*/
if (m->m_flags & (M_BCAST|M_MCAST)) {
if ((s = tcp_log_addrs(&inc, th, NULL, NULL)))
@ -1335,7 +1335,7 @@ tfo_socket_result:
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
IN_MULTICAST(ntohl(ip->ip_src.s_addr)) ||
ip->ip_src.s_addr == htonl(INADDR_BROADCAST) ||
in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) {
in_ifnet_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) {
if ((s = tcp_log_addrs(&inc, th, NULL, NULL)))
log(LOG_DEBUG, "%s; %s: Listen socket: "
"Connection attempt from/to broad- "
@ -3522,7 +3522,7 @@ tcp_dropwithreset(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp,
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
IN_MULTICAST(ntohl(ip->ip_src.s_addr)) ||
ip->ip_src.s_addr == htonl(INADDR_BROADCAST) ||
in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif))
in_ifnet_broadcast(ip->ip_dst, m->m_pkthdr.rcvif))
goto drop;
}
#endif

View file

@ -583,7 +583,7 @@ udp_input(struct mbuf **mp, int *offp, int proto)
}
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
in_broadcast(ip->ip_dst, ifp))
in_ifnet_broadcast(ip->ip_dst, ifp))
return (udp_multi_input(m, proto, udp_in));
pcbinfo = udp_get_inpcbinfo(proto);