Print this page
11547 Want connstat(1M) command to display per-connection TCP statistics
Portions contributed by: Cody Peter Mello <cody.mello@joyent.com>
Portions contributed by: Ahmed G <ahmedg@delphix.com>
Reviewed by: Jason King <jason.king@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/ip.c
          +++ new/usr/src/uts/common/inet/ip/ip.c
↓ open down ↓ 9627 lines elided ↑ open up ↑
9628 9628          if (!(level == MIB2_TCP || level == MIB2_UDP)) {
9629 9629                  if ((mpctl = icmp_snmp_get(q, mpctl)) == NULL) {
9630 9630                          return (1);
9631 9631                  }
9632 9632          }
9633 9633  
9634 9634          if (level != MIB2_TCP) {
9635 9635                  if ((mpctl = udp_snmp_get(q, mpctl, legacy_req)) == NULL) {
9636 9636                          return (1);
9637 9637                  }
     9638 +                if (level == MIB2_UDP) {
     9639 +                        goto done;
     9640 +                }
9638 9641          }
9639 9642  
9640 9643          if (level != MIB2_UDP) {
9641 9644                  if ((mpctl = tcp_snmp_get(q, mpctl, legacy_req)) == NULL) {
9642 9645                          return (1);
9643 9646                  }
     9647 +                if (level == MIB2_TCP) {
     9648 +                        goto done;
     9649 +                }
9644 9650          }
9645 9651  
9646 9652          if ((mpctl = ip_snmp_get_mib2_ip_traffic_stats(q, mpctl,
9647 9653              ipst, legacy_req)) == NULL) {
9648 9654                  return (1);
9649 9655          }
9650 9656  
9651 9657          if ((mpctl = ip_snmp_get_mib2_ip6(q, mpctl, ipst,
9652 9658              legacy_req)) == NULL) {
9653 9659                  return (1);
↓ open down ↓ 56 lines elided ↑ open up ↑
9710 9716          mpctl = ip_snmp_get_mib2_ip6_route_media(q, mpctl, level, ipst);
9711 9717          if (mpctl == NULL)
9712 9718                  return (1);
9713 9719  
9714 9720          if ((mpctl = sctp_snmp_get_mib2(q, mpctl, sctps)) == NULL) {
9715 9721                  return (1);
9716 9722          }
9717 9723          if ((mpctl = ip_snmp_get_mib2_ip_dce(q, mpctl, ipst)) == NULL) {
9718 9724                  return (1);
9719 9725          }
     9726 +done:
9720 9727          freemsg(mpctl);
9721 9728          return (1);
9722 9729  }
9723 9730  
9724 9731  /* Get global (legacy) IPv4 statistics */
9725 9732  static mblk_t *
9726 9733  ip_snmp_get_mib2_ip(queue_t *q, mblk_t *mpctl, mib2_ipIfStatsEntry_t *ipmib,
9727 9734      ip_stack_t *ipst, boolean_t legacy_req)
9728 9735  {
9729 9736          mib2_ip_t               old_ip_mib;
↓ open down ↓ 5564 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX