X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3d11d28ba07fffcbfd460cdb1fe95eded061e2f3..2d861fb1a7677d1d2437e5e6d3e04a095a93b91f:/print-nsh.c diff --git a/print-nsh.c b/print-nsh.c index 1a27b713..abd722d4 100644 --- a/print-nsh.c +++ b/print-nsh.c @@ -21,6 +21,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* \summary: Network Service Header (NSH) printer */ + +/* specification: draft-ietf-sfc-nsh-01 */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -39,11 +43,7 @@ static const struct tok nsh_flags [] = { #define NSH_BASE_HDR_LEN 4 #define NSH_SERVICE_PATH_HDR_LEN 4 -#define NSH_HDR_WORD_SIZE 4 - -/* - * NSH, draft-ietf-sfc-nsh-01 Network Service Header - */ +#define NSH_HDR_WORD_SIZE 4U void nsh_print(netdissect_options *ndo, const u_char *bp, u_int len) @@ -170,7 +170,7 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len) ip6_print(ndo, bp, next_len); break; case 0x3: - ether_print(ndo, bp, next_len, next_len, NULL, NULL); + ether_print(ndo, bp, next_len, ndo->ndo_snapend - bp, NULL, NULL); break; default: ND_PRINT((ndo, "ERROR: unknown-next-protocol"));