Print this page
4587 snoop misdecodes DHCPv6 DHCPV6_DUID_LL identifiers

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_arp.c
          +++ new/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_arp.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   26  #include <sys/types.h>
  29   27  #include <sys/errno.h>
  30   28  #include <setjmp.h>
       29 +#include <stdio.h>
       30 +#include <stdlib.h>
       31 +#include <string.h>
  31   32  #include <sys/socket.h>
  32   33  #include <net/if.h>
  33   34  #include <net/if_arp.h>
  34   35  #include <netinet/in_systm.h>
  35   36  #include <netinet/in.h>
  36   37  #include <netinet/ip.h>
  37   38  #include <netinet/if_ether.h>
  38   39  #include <netdb.h>
  39   40  #include <net/if_types.h>
       41 +#include <arpa/inet.h>
  40   42  
  41   43  #include "snoop.h"
  42   44  
  43   45  extern char *dlc_header;
  44   46  extern jmp_buf xdr_err;
  45   47  
  46   48  static char *printip(unsigned char *);
  47   49  static char *addrtoname_align(unsigned char *);
  48   50  
  49   51  static char unarp_addr[] = "Unknown";
↓ open down ↓ 162 lines elided ↑ open up ↑
 212  214   * These numbers are assigned by the IANA.  See the arp-parameters registry.
 213  215   * Only those values that are used within Solaris have #defines.
 214  216   */
 215  217  const char *
 216  218  arp_htype(int t)
 217  219  {
 218  220          switch (t) {
 219  221          case ARPHRD_ETHER:
 220  222                  return ("Ethernet (10Mb)");
 221  223          case 2:
 222      -                return ("Experimental Ethernet (3MB)");
      224 +                return ("Experimental Ethernet (3Mb)");
 223  225          case 3:
 224  226                  return ("Amateur Radio AX.25");
 225  227          case 4:
 226  228                  return ("Proteon ProNET Token Ring");
 227  229          case 5:
 228  230                  return ("Chaos");
 229  231          case ARPHRD_IEEE802:
 230  232                  return ("IEEE 802");
 231  233          case 7:
 232  234                  return ("ARCNET");
↓ open down ↓ 14 lines elided ↑ open up ↑
 247  249          case ARPHRD_FRAME:
 248  250                  return ("Frame Relay");
 249  251          case ARPHRD_ATM:
 250  252                  return ("ATM");
 251  253          case ARPHRD_HDLC:
 252  254                  return ("HDLC");
 253  255          case ARPHRD_FC:
 254  256                  return ("Fibre Channel");
 255  257          case ARPHRD_IPATM:
 256  258                  return ("IP-ATM");
      259 +        case ARPHRD_METRICOM:
      260 +                return ("Metricom");
 257  261          case ARPHRD_TUNNEL:
 258  262                  return ("Tunnel");
 259  263          case ARPHRD_IB:
 260  264                  return ("IPIB");
 261  265          };
 262  266          return ("UNKNOWN");
 263  267  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX