summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet/igmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/netinet/igmp.c')
-rw-r--r--freebsd/sys/netinet/igmp.c111
1 files changed, 51 insertions, 60 deletions
diff --git a/freebsd/sys/netinet/igmp.c b/freebsd/sys/netinet/igmp.c
index 12bb2f07..9443bb64 100644
--- a/freebsd/sys/netinet/igmp.c
+++ b/freebsd/sys/netinet/igmp.c
@@ -17,7 +17,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -314,17 +314,6 @@ igmp_scrub_context(struct mbuf *m)
m->m_pkthdr.flowid = 0;
}
-#ifdef KTR
-static __inline char *
-inet_ntoa_haddr(in_addr_t haddr)
-{
- struct in_addr ia;
-
- ia.s_addr = htonl(haddr);
- return (inet_ntoa(ia));
-}
-#endif
-
/*
* Restore context from a queued IGMP output chain.
* Return saved ifindex.
@@ -874,8 +863,9 @@ igmp_input_v2_query(struct ifnet *ifp, const struct ip *ip,
*/
inm = inm_lookup(ifp, igmp->igmp_group);
if (inm != NULL) {
- CTR3(KTR_IGMPV3, "process v2 query %s on ifp %p(%s)",
- inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname);
+ CTR3(KTR_IGMPV3,
+ "process v2 query 0x%08x on ifp %p(%s)",
+ ntohl(igmp->igmp_group.s_addr), ifp, ifp->if_xname);
igmp_v2_update_group(inm, timer);
}
}
@@ -906,8 +896,8 @@ static void
igmp_v2_update_group(struct in_multi *inm, const int timer)
{
- CTR4(KTR_IGMPV3, "%s: %s/%s timer=%d", __func__,
- inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname, timer);
+ CTR4(KTR_IGMPV3, "0x%08x: %s/%s timer=%d", __func__,
+ ntohl(inm->inm_addr.s_addr), inm->inm_ifp->if_xname, timer);
IN_MULTI_LOCK_ASSERT();
@@ -1087,8 +1077,8 @@ igmp_input_v3_query(struct ifnet *ifp, const struct ip *ip,
goto out_locked;
}
}
- CTR3(KTR_IGMPV3, "process v3 %s query on ifp %p(%s)",
- inet_ntoa(igmpv3->igmp_group), ifp, ifp->if_xname);
+ CTR3(KTR_IGMPV3, "process v3 0x%08x query on ifp %p(%s)",
+ ntohl(igmpv3->igmp_group.s_addr), ifp, ifp->if_xname);
/*
* If there is a pending General Query response
* scheduled sooner than the selected delay, no
@@ -1248,8 +1238,8 @@ igmp_input_v1_report(struct ifnet *ifp, /*const*/ struct ip *ip,
}
}
- CTR3(KTR_IGMPV3, "process v1 report %s on ifp %p(%s)",
- inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname);
+ CTR3(KTR_IGMPV3, "process v1 report 0x%08x on ifp %p(%s)",
+ ntohl(igmp->igmp_group.s_addr), ifp, ifp->if_xname);
/*
* IGMPv1 report suppression.
@@ -1291,15 +1281,17 @@ igmp_input_v1_report(struct ifnet *ifp, /*const*/ struct ip *ip,
case IGMP_LAZY_MEMBER:
case IGMP_AWAKENING_MEMBER:
CTR3(KTR_IGMPV3,
- "report suppressed for %s on ifp %p(%s)",
- inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname);
+ "report suppressed for 0x%08x on ifp %p(%s)",
+ ntohl(igmp->igmp_group.s_addr), ifp,
+ ifp->if_xname);
case IGMP_SLEEPING_MEMBER:
inm->inm_state = IGMP_SLEEPING_MEMBER;
break;
case IGMP_REPORTING_MEMBER:
CTR3(KTR_IGMPV3,
- "report suppressed for %s on ifp %p(%s)",
- inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname);
+ "report suppressed for 0x%08x on ifp %p(%s)",
+ ntohl(igmp->igmp_group.s_addr), ifp,
+ ifp->if_xname);
if (igi->igi_version == IGMP_VERSION_1)
inm->inm_state = IGMP_LAZY_MEMBER;
else if (igi->igi_version == IGMP_VERSION_2)
@@ -1372,8 +1364,8 @@ igmp_input_v2_report(struct ifnet *ifp, /*const*/ struct ip *ip,
if (ia != NULL)
ifa_free(&ia->ia_ifa);
- CTR3(KTR_IGMPV3, "process v2 report %s on ifp %p(%s)",
- inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname);
+ CTR3(KTR_IGMPV3, "process v2 report 0x%08x on ifp %p(%s)",
+ ntohl(igmp->igmp_group.s_addr), ifp, ifp->if_xname);
/*
* IGMPv2 report suppression.
@@ -1413,8 +1405,8 @@ igmp_input_v2_report(struct ifnet *ifp, /*const*/ struct ip *ip,
case IGMP_IDLE_MEMBER:
case IGMP_AWAKENING_MEMBER:
CTR3(KTR_IGMPV3,
- "report suppressed for %s on ifp %p(%s)",
- inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname);
+ "report suppressed for 0x%08x on ifp %p(%s)",
+ ntohl(igmp->igmp_group.s_addr), ifp, ifp->if_xname);
case IGMP_LAZY_MEMBER:
inm->inm_state = IGMP_LAZY_MEMBER;
break;
@@ -1901,8 +1893,9 @@ igmp_v3_process_group_timers(struct igmp_ifsoftc *igi,
(void)igmp_v3_merge_state_changes(inm, scq);
inm_commit(inm);
- CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__,
- inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname);
+ CTR3(KTR_IGMPV3, "%s: T1 -> T0 for 0x%08x/%s", __func__,
+ ntohl(inm->inm_addr.s_addr),
+ inm->inm_ifp->if_xname);
/*
* If we are leaving the group for good, make sure
@@ -2348,10 +2341,9 @@ igmp_initial_join(struct in_multi *inm, struct igmp_ifsoftc *igi)
struct ifnet *ifp;
struct mbufq *mq;
int error, retval, syncstates;
-
- CTR4(KTR_IGMPV3, "%s: initial join %s on ifp %p(%s)",
- __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp,
- inm->inm_ifp->if_xname);
+
+ CTR4(KTR_IGMPV3, "%s: initial join 0x%08x on ifp %p(%s)", __func__,
+ ntohl(inm->inm_addr.s_addr), inm->inm_ifp, inm->inm_ifp->if_xname);
error = 0;
syncstates = 1;
@@ -2460,8 +2452,8 @@ igmp_initial_join(struct in_multi *inm, struct igmp_ifsoftc *igi)
*/
if (syncstates) {
inm_commit(inm);
- CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__,
- inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname);
+ CTR3(KTR_IGMPV3, "%s: T1 -> T0 for 0x%08x/%s", __func__,
+ ntohl(inm->inm_addr.s_addr), inm->inm_ifp->if_xname);
}
return (error);
@@ -2476,9 +2468,8 @@ igmp_handle_state_change(struct in_multi *inm, struct igmp_ifsoftc *igi)
struct ifnet *ifp;
int retval;
- CTR4(KTR_IGMPV3, "%s: state change for %s on ifp %p(%s)",
- __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp,
- inm->inm_ifp->if_xname);
+ CTR4(KTR_IGMPV3, "%s: state change for 0x%08x on ifp %p(%s)", __func__,
+ ntohl(inm->inm_addr.s_addr), inm->inm_ifp, inm->inm_ifp->if_xname);
ifp = inm->inm_ifp;
@@ -2497,8 +2488,8 @@ igmp_handle_state_change(struct in_multi *inm, struct igmp_ifsoftc *igi)
}
CTR1(KTR_IGMPV3, "%s: nothing to do", __func__);
inm_commit(inm);
- CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__,
- inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname);
+ CTR3(KTR_IGMPV3, "%s: T1 -> T0 for 0x%08x/%s", __func__,
+ ntohl(inm->inm_addr.s_addr), inm->inm_ifp->if_xname);
return (0);
}
@@ -2536,8 +2527,8 @@ igmp_final_leave(struct in_multi *inm, struct igmp_ifsoftc *igi)
syncstates = 1;
- CTR4(KTR_IGMPV3, "%s: final leave %s on ifp %p(%s)",
- __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp,
+ CTR4(KTR_IGMPV3, "%s: final leave 0x%08x on ifp %p(%s)",
+ __func__, ntohl(inm->inm_addr.s_addr), inm->inm_ifp,
inm->inm_ifp->if_xname);
IN_MULTI_LOCK_ASSERT();
@@ -2578,9 +2569,9 @@ igmp_final_leave(struct in_multi *inm, struct igmp_ifsoftc *igi)
} else {
inm->inm_scrv = igi->igi_rv;
}
- CTR4(KTR_IGMPV3, "%s: Leaving %s/%s with %d "
+ CTR4(KTR_IGMPV3, "%s: Leaving 0x%08x/%s with %d "
"pending retransmissions.", __func__,
- inet_ntoa(inm->inm_addr),
+ ntohl(inm->inm_addr.s_addr),
inm->inm_ifp->if_xname, inm->inm_scrv);
if (inm->inm_scrv == 0) {
inm->inm_state = IGMP_NOT_MEMBER;
@@ -2613,11 +2604,12 @@ igmp_final_leave(struct in_multi *inm, struct igmp_ifsoftc *igi)
if (syncstates) {
inm_commit(inm);
- CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__,
- inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname);
+ CTR3(KTR_IGMPV3, "%s: T1 -> T0 for 0x%08x/%s", __func__,
+ ntohl(inm->inm_addr.s_addr), inm->inm_ifp->if_xname);
inm->inm_st[1].iss_fmode = MCAST_UNDEFINED;
- CTR3(KTR_IGMPV3, "%s: T1 now MCAST_UNDEFINED for %s/%s",
- __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname);
+ CTR3(KTR_IGMPV3, "%s: T1 now MCAST_UNDEFINED for 0x%08x/%s",
+ __func__, ntohl(inm->inm_addr.s_addr),
+ inm->inm_ifp->if_xname);
}
}
@@ -2742,9 +2734,8 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct in_multi *inm,
return (igmp_v3_enqueue_filter_change(mq, inm));
if (type == IGMP_DO_NOTHING) {
- CTR3(KTR_IGMPV3, "%s: nothing to do for %s/%s",
- __func__, inet_ntoa(inm->inm_addr),
- inm->inm_ifp->if_xname);
+ CTR3(KTR_IGMPV3, "%s: nothing to do for 0x%08x/%s", __func__,
+ ntohl(inm->inm_addr.s_addr), inm->inm_ifp->if_xname);
return (0);
}
@@ -2757,8 +2748,8 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct in_multi *inm,
if (record_has_sources)
minrec0len += sizeof(in_addr_t);
- CTR4(KTR_IGMPV3, "%s: queueing %s for %s/%s", __func__,
- igmp_rec_type_to_str(type), inet_ntoa(inm->inm_addr),
+ CTR4(KTR_IGMPV3, "%s: queueing %s for 0x%08x/%s", __func__,
+ igmp_rec_type_to_str(type), ntohl(inm->inm_addr.s_addr),
inm->inm_ifp->if_xname);
/*
@@ -2846,8 +2837,8 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct in_multi *inm,
}
msrcs = 0;
RB_FOREACH_SAFE(ims, ip_msource_tree, &inm->inm_srcs, nims) {
- CTR2(KTR_IGMPV3, "%s: visit node %s", __func__,
- inet_ntoa_haddr(ims->ims_haddr));
+ CTR2(KTR_IGMPV3, "%s: visit node 0x%08x", __func__,
+ ims->ims_haddr);
now = ims_get_mode(inm, ims, 1);
CTR2(KTR_IGMPV3, "%s: node is %d", __func__, now);
if ((now != mode) ||
@@ -2942,8 +2933,8 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct in_multi *inm,
msrcs = 0;
RB_FOREACH_FROM(ims, ip_msource_tree, nims) {
- CTR2(KTR_IGMPV3, "%s: visit node %s", __func__,
- inet_ntoa_haddr(ims->ims_haddr));
+ CTR2(KTR_IGMPV3, "%s: visit node 0x%08x", __func__,
+ ims->ims_haddr);
now = ims_get_mode(inm, ims, 1);
if ((now != mode) ||
(now == mode && mode == MCAST_UNDEFINED)) {
@@ -3134,8 +3125,8 @@ igmp_v3_enqueue_filter_change(struct mbufq *mq, struct in_multi *inm)
if (nims == NULL)
nims = RB_MIN(ip_msource_tree, &inm->inm_srcs);
RB_FOREACH_FROM(ims, ip_msource_tree, nims) {
- CTR2(KTR_IGMPV3, "%s: visit node %s",
- __func__, inet_ntoa_haddr(ims->ims_haddr));
+ CTR2(KTR_IGMPV3, "%s: visit node 0x%08x",
+ __func__, ims->ims_haddr);
now = ims_get_mode(inm, ims, 1);
then = ims_get_mode(inm, ims, 0);
CTR3(KTR_IGMPV3, "%s: mode: t0 %d, t1 %d",