aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_output.c
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2018-09-30 12:16:06 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2018-09-30 12:16:06 +0000
commitae0a9a88504a1a2adb6ff3ab3a5d83084540087b (patch)
treec91ecf5e508deb4fcc7c0f62d4ed672499695e44 /sys/netinet/sctp_output.c
parent916023bda93374d9d76a10e15eaaade8b77ab5bc (diff)
downloadsrc-ae0a9a88504a1a2adb6ff3ab3a5d83084540087b.tar.gz
src-ae0a9a88504a1a2adb6ff3ab3a5d83084540087b.zip
Increment the corresponding UDP stats counter (udps_opackets) when
sending UDP encapsulated SCTP packets. This is consistent with the behaviour that when such packets are received, the corresponding UDP stats counter (udps_ipackets) is incremented. Thanks to Peter Lei for making me aware of this inconsistency. Approved by: re (kib@) MFC after: 1 week
Notes
Notes: svn path=/head/; revision=339022
Diffstat (limited to 'sys/netinet/sctp_output.c')
-rw-r--r--sys/netinet/sctp_output.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 2d084f018425..d0bde9f04a4d 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -4263,6 +4263,9 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
atomic_subtract_int(&stcb->asoc.refcnt, 1);
}
#endif
+ if (port) {
+ UDPSTAT_INC(udps_opackets);
+ }
SCTP_STAT_INCR(sctps_sendpackets);
SCTP_STAT_INCR_COUNTER64(sctps_outpackets);
if (ret)
@@ -4603,6 +4606,9 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
sin6->sin6_port = prev_port;
}
SCTPDBG(SCTP_DEBUG_OUTPUT3, "return from send is %d\n", ret);
+ if (port) {
+ UDPSTAT_INC(udps_opackets);
+ }
SCTP_STAT_INCR(sctps_sendpackets);
SCTP_STAT_INCR_COUNTER64(sctps_outpackets);
if (ret) {
@@ -11290,6 +11296,9 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
return;
}
SCTPDBG(SCTP_DEBUG_OUTPUT3, "return from send is %d\n", ret);
+ if (port) {
+ UDPSTAT_INC(udps_opackets);
+ }
SCTP_STAT_INCR(sctps_sendpackets);
SCTP_STAT_INCR_COUNTER64(sctps_outpackets);
SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks);