X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/913a9fa71293ce12b3c1dea3d93d3a97cf685625..c2c25496778d0994b1c3874a03d3e411ac1cee6e:/print-lisp.c diff --git a/print-lisp.c b/print-lisp.c index 756fff0f..b995f2df 100644 --- a/print-lisp.c +++ b/print-lisp.c @@ -94,9 +94,7 @@ * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" #include "netdissect.h" @@ -129,12 +127,12 @@ enum { }; static const struct tok lisp_type [] = { - { 0, "LISP-Reserved" }, - { 1, "LISP-Map-Request" }, - { 2, "LISP-Map-Reply" }, - { 3, "LISP-Map-Register" }, - { 4, "LISP-Map-Notify" }, - { 8, "LISP-Encapsulated-Contol-Message" }, + { 0, "LISP-Reserved" }, + { 1, "LISP-Map-Request" }, + { 2, "LISP-Map-Reply" }, + { 3, "LISP-Map-Register" }, + { 4, "LISP-Map-Notify" }, + { 8, "LISP-Encapsulated-Control-Message" }, { 0, NULL } }; @@ -242,7 +240,6 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) uint16_t auth_data_len; uint32_t ttl; const u_char *packet_iterator; - const u_char *loc_ip_pointer; const lisp_map_register_hdr *lisp_hdr; const lisp_map_register_eid *lisp_eid; const lisp_map_register_loc *lisp_loc; @@ -321,7 +318,6 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) * No support for LCAF right now. */ return; - break; } ND_PRINT(" %u locator(s)", loc_count); @@ -331,7 +327,6 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) ND_TCHECK_LEN(packet_iterator + packet_offset, MAP_REGISTER_LOC_LEN); lisp_loc = (const lisp_map_register_loc *) (packet_iterator + packet_offset); - loc_ip_pointer = (const u_char *) (lisp_loc + 1); packet_offset += MAP_REGISTER_LOC_LEN; loc_afi = GET_BE_U_2(lisp_loc->locator_afi); @@ -340,13 +335,15 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) switch (loc_afi) { case IPv4_AFI: - ND_TCHECK_4(packet_iterator + packet_offset); - ND_PRINT(" LOC %s", GET_IPADDR_STRING(loc_ip_pointer)); + ND_PRINT(" LOC %s", + GET_IPADDR_STRING(packet_iterator + + packet_offset)); packet_offset += 4; break; case IPv6_AFI: - ND_TCHECK_16(packet_iterator + packet_offset); - ND_PRINT(" LOC %s", GET_IP6ADDR_STRING(loc_ip_pointer)); + ND_PRINT(" LOC %s", + GET_IP6ADDR_STRING(packet_iterator + + packet_offset)); packet_offset += 16; break; default: