git: 197fc4cad097 - main - netinet: rename in_broadcast() to in_ifnet_broadcast()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 22 Feb 2025 02:12:43 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=197fc4cad0973efa4bb2ab86ed537eafa3ae254e
commit 197fc4cad0973efa4bb2ab86ed537eafa3ae254e
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-02-22 02:10:53 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-02-22 02:10:53 +0000
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
---
sys/netinet/in.c | 2 +-
sys/netinet/in.h | 2 +-
sys/netinet/in_rmx.c | 2 +-
sys/netinet/ip_divert.c | 2 +-
sys/netinet/sctp_os_bsd.h | 2 +-
sys/netinet/tcp_input.c | 6 +++---
sys/netinet/udp_usrreq.c | 2 +-
7 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 0cf148c38575..7d8cbc6725ad 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -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;
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index e03fe3391388..0ee4200017b5 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -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);
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index aedfd0bc08c7..b8599143b991 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -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);
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 6bc76e0be111..5a561814cdb5 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -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);
diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h
index eb0caec942e9..9cec02aa6a07 100644
--- a/sys/netinet/sctp_os_bsd.h
+++ b/sys/netinet/sctp_os_bsd.h
@@ -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
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 12dc4670f531..e21043fac0cf 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -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
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 8278efcae60c..6c855e7a756b 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -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);