Print this page
8485 Remove set but unused variables in usr/src/cmd

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_dhcpv6.c
          +++ new/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_dhcpv6.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
       23 + * Copyright 2017 Gary Mills
  23   24   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   25   * Use is subject to license terms.
  25   26   */
  26   27  
  27   28  /*
  28   29   * Dynamic Host Configuration Protocol version 6, for IPv6.  Supports
  29   30   * RFCs 3315, 3319, 3646, 3898, 4075, 4242, 4280, 4580, 4649, and 4704.
  30   31   */
  31   32  
  32   33  #include <ctype.h>
↓ open down ↓ 544 lines elided ↑ open up ↑
 577  578          show_options(data, olen);
 578  579          free(str);
 579  580          prot_prefix = oldprefix;
 580  581          prot_nest_prefix = oldnest;
 581  582  }
 582  583  
 583  584  static void
 584  585  show_options(const uint8_t *data, int len)
 585  586  {
 586  587          dhcpv6_option_t d6o;
 587      -        uint_t olen, retlen;
      588 +        uint_t olen;
 588  589          uint16_t val16;
 589  590          uint16_t type;
 590  591          uint32_t val32;
 591  592          const uint8_t *ostart;
 592  593          char *str, *sp;
 593  594          char *oldnest;
 594  595  
 595  596          /*
 596  597           * Be very careful with negative numbers; ANSI signed/unsigned
 597  598           * comparison doesn't work as expected.
↓ open down ↓ 161 lines elided ↑ open up ↑
 759  760                                  (void) snprintf(get_line(0, 0),
 760  761                                      get_line_remain(),
 761  762                                      "  Elapsed Time = %u.%02u seconds",
 762  763                                      val16 / 100, val16 % 100);
 763  764                          }
 764  765                          break;
 765  766                  case DHCPV6_OPT_RELAY_MSG:
 766  767                          if (olen > 0) {
 767  768                                  oldnest = prot_nest_prefix;
 768  769                                  prot_nest_prefix = prot_prefix;
 769      -                                retlen = interpret_dhcpv6(F_DTAIL, data, olen);
      770 +                                (void) interpret_dhcpv6(F_DTAIL, data, olen);
 770  771                                  prot_prefix = prot_nest_prefix;
 771  772                                  prot_nest_prefix = oldnest;
 772  773                          }
 773  774                          break;
 774  775                  case DHCPV6_OPT_AUTH: {
 775  776                          dhcpv6_auth_t d6a;
 776  777  
 777  778                          if (olen < DHCPV6_AUTH_SIZE - sizeof (d6o))
 778  779                                  break;
 779  780                          (void) memcpy(&d6a, data - sizeof (d6o),
↓ open down ↓ 272 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX