Page MenuHomeFreeBSD

D16046.id45357.diff
No OneTemporary

D16046.id45357.diff

Index: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
===================================================================
--- cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
+++ cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
@@ -25,7 +25,7 @@
#
#
-# Test ip:::{send,receive} of IPv4 UDP to a local address.
+# Test {ip,udp}:::{send,receive} of IPv4 UDP to a local address.
#
# This may fail due to:
#
@@ -42,11 +42,11 @@
# 1 x ip:::send (UDP sent to UDP port 33434)
# 1 x udp:::send (UDP sent to UDP port 33434)
# 1 x ip:::receive (UDP received)
+# 1 x udp:::receive (UDP received)
#
-# No udp:::receive event is expected since the UDP packet elicts
-# an ICMP PORT_UNREACHABLE response rather than a UDP packet, and locally
-# the echo request UDP packet only reaches IP, so the udp:::receive probe
-# is not triggered by it.
+# A udp:::receive event is expected even if the received UDP packet
+# elicts an ICMP PORT_UNREACHABLE message since there is no UDP
+# socket for receiving the packet.
#
if (( $# != 1 )); then
@@ -77,7 +77,7 @@
$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
BEGIN
{
- ipsend = udpsend = ipreceive = 0;
+ ipsend = udpsend = ipreceive = udpreceive = 0;
}
ip:::send
@@ -100,12 +100,19 @@
ipreceive++;
}
+udp:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/
+{
+ udpreceive++;
+}
+
END
{
printf("Minimum UDP events seen\n\n");
printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no");
printf("ip:::receive - %s\n", ipreceive >= 1 ? "yes" : "no");
printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no");
+ printf("udp:::receive - %s\n", udpreceive >= 1 ? "yes" : "no");
}
EODTRACE
Index: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
===================================================================
--- cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
+++ cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
@@ -3,4 +3,5 @@
ip:::send - yes
ip:::receive - yes
udp:::send - yes
+udp:::receive - yes
Index: sys/netinet/udp_usrreq.c
===================================================================
--- sys/netinet/udp_usrreq.c
+++ sys/netinet/udp_usrreq.c
@@ -685,6 +685,7 @@
inet_ntoa_r(ip->ip_dst, dst), ntohs(uh->uh_dport),
inet_ntoa_r(ip->ip_src, src), ntohs(uh->uh_sport));
}
+ UDP_PROBE(receive, NULL, NULL, ip, NULL, uh);
UDPSTAT_INC(udps_noport);
if (m->m_flags & (M_BCAST | M_MCAST)) {
UDPSTAT_INC(udps_noportbcast);
@@ -704,6 +705,7 @@
*/
INP_RLOCK_ASSERT(inp);
if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) {
+ UDP_PROBE(receive, NULL, inp, ip, inp, uh);
INP_RUNLOCK(inp);
m_freem(m);
return (IPPROTO_DONE);
Index: sys/netinet6/udp6_usrreq.c
===================================================================
--- sys/netinet6/udp6_usrreq.c
+++ sys/netinet6/udp6_usrreq.c
@@ -483,6 +483,7 @@
ip6_sprintf(ip6bufs, &ip6->ip6_src),
ntohs(uh->uh_sport));
}
+ UDP_PROBE(receive, NULL, NULL, ip6, NULL, uh);
UDPSTAT_INC(udps_noport);
if (m->m_flags & M_MCAST) {
printf("UDP6: M_MCAST is set in a unicast packet.\n");

File Metadata

Mime Type
text/plain
Expires
Mon, Aug 17, 7:19 PM (1 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36863338
Default Alt Text
D16046.id45357.diff (3 KB)

Event Timeline