]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-sctp.c
From Andrew Silent: Realtek Remote Control Protocol support (see
[tcpdump] / print-sctp.c
index a491481bd21b0e2fd3cf254c58968842113133a2..05c753a52e6cf892953ebbfc60ce1b207e58327a 100644 (file)
@@ -35,7 +35,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.18 2005-05-05 23:08:43 guy Exp $ (NETLAB/PEL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.21 2007-09-13 18:03:49 guy Exp $ (NETLAB/PEL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -146,7 +146,7 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
        break;
       }
 
-      TCHECK2(*(((u_int8_t *)chunkDescPtr) + chunkLength), chunkLength);
+      TCHECK2(*((u_int8_t *)chunkDescPtr), chunkLength);
       chunkEnd = ((const u_char*)chunkDescPtr + chunkLength);
 
       align=chunkLength % 4;
@@ -200,12 +200,13 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
 
                printf("[Payload");
 
-               if (!xflag && !qflag) {
+               if (!suppress_default_print) {
                        payloadPtr = (const u_char *) (++dataHdrPtr);
                        printf(":");
                        if (htons(chunkDescPtr->chunkLength) <
                            sizeof(struct sctpDataPart)+
                            sizeof(struct sctpChunkDesc)+1) {
+                               /* Less than 1 byte of chunk payload */
                                printf("bogus chunk length %u]",
                                    htons(chunkDescPtr->chunkLength));
                                return;
@@ -213,7 +214,7 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
                        default_print(payloadPtr,
                              htons(chunkDescPtr->chunkLength) -
                              (sizeof(struct sctpDataPart)+
-                             sizeof(struct sctpChunkDesc)+1));
+                             sizeof(struct sctpChunkDesc)));
                } else
                        printf("]");
              }