From e3cf25119303de591c56c4173d81b0616732bd2d Mon Sep 17 00:00:00 2001 From: Hoelscher <jens.hoelscher@fh-muenster.de> Date: Fri, 13 May 2016 15:28:24 +0200 Subject: [PATCH] fix chunk_to_string for reconfig parameter --- gtests/net/packetdrill/sctp_chunk_to_string.c | 6 +++--- gtests/net/packetdrill/sctp_packet.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gtests/net/packetdrill/sctp_chunk_to_string.c b/gtests/net/packetdrill/sctp_chunk_to_string.c index 8ab9d93a..29f7b805 100644 --- a/gtests/net/packetdrill/sctp_chunk_to_string.c +++ b/gtests/net/packetdrill/sctp_chunk_to_string.c @@ -328,7 +328,7 @@ static int sctp_outgoing_ssn_reset_request_parameter_to_string( int len; length = ntohs(parameter->length); - if (length != sizeof(struct sctp_outgoing_ssn_reset_request_parameter)) { + if (length < sizeof(struct sctp_outgoing_ssn_reset_request_parameter)) { fputs("invalid OUTGOING_SSN_RESET_REQUEST parameter", s); asprintf(error, "OUTGOING_SSN_RESET_REQUEST parameter illegal (length=%u)", length); @@ -364,7 +364,7 @@ static int sctp_incoming_ssn_reset_request_parameter_to_string( int len; length = ntohs(parameter->length); - if (length != sizeof(struct sctp_incoming_ssn_reset_request_parameter)) { + if (length < sizeof(struct sctp_incoming_ssn_reset_request_parameter)) { fputs("invalid INCOMING_SSN_RESET_REQUEST parameter", s); asprintf(error, "INCOMING_SSN_RESET_REQUEST parameter illegal (length=%u)", length); @@ -424,7 +424,7 @@ static int sctp_reconfig_response_parameter_to_string( length = ntohs(parameter->length); // filter correct length if (!(length == sizeof(struct sctp_reconfig_response_parameter)) && - !(length != sizeof(struct sctp_reconfig_response_parameter) - 8)) { + !(length == sizeof(struct sctp_reconfig_response_parameter) - 8)) { fputs("invalid RECONFIG_RESPONSE parameter", s); asprintf(error, "RECONFIG_RESPONSE parameter illegal (length=%u)", length); diff --git a/gtests/net/packetdrill/sctp_packet.h b/gtests/net/packetdrill/sctp_packet.h index 7581f207..01922281 100644 --- a/gtests/net/packetdrill/sctp_packet.h +++ b/gtests/net/packetdrill/sctp_packet.h @@ -1,4 +1,3 @@ - /* * Copyright 2015 Michael Tuexen * -- GitLab