Author: tuexen
Date: Sun Sep 30 12:16:06 2018
New Revision: 339022
URL: https://svnweb.freebsd.org/changeset/base/339022

Log:
  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

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c      Sun Sep 30 08:41:14 2018        
(r339021)
+++ head/sys/netinet/sctp_output.c      Sun Sep 30 12:16:06 2018        
(r339022)
@@ -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 sockad
                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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to