- if (mdss->M) {
- printf(" seq ");
- if (mdss->m)
- printf("%" PRIu64, EXTRACT_64BITS(opt));
- else
- printf("%" PRIu32, EXTRACT_32BITS(opt));
- opt += mdss->m ? 8 : 4;
- printf(" subseq %" PRIu32, EXTRACT_32BITS(opt));
+ if (mdss->flags & MP_DSS_M) {
+ /*
+ * Data Sequence Number (DSN), Subflow Sequence Number (SSN),
+ * Data-Level Length present, and Checksum possibly present.
+ */
+ ND_PRINT((ndo, " seq "));
+ /*
+ * If the m flag is set, we have an 8-byte NDS; if it's clear,
+ * we have a 4-byte DSN.
+ */
+ if (mdss->flags & MP_DSS_m) {
+ if (opt_len < 8)
+ return 0;
+ ND_PRINT((ndo, "%" PRIu64, EXTRACT_BE_64BITS(opt)));
+ opt += 8;
+ opt_len -= 8;
+ } else {
+ if (opt_len < 4)
+ return 0;
+ ND_PRINT((ndo, "%u", EXTRACT_BE_32BITS(opt)));
+ opt += 4;
+ opt_len -= 4;
+ }
+ if (opt_len < 4)
+ return 0;
+ ND_PRINT((ndo, " subseq %u", EXTRACT_BE_32BITS(opt)));