From e92514f720c1ab7f3d14fdb2375c651a8057c24b Mon Sep 17 00:00:00 2001 From: Hoelscher <jens.hoelscher@fh-muenster.de> Date: Sun, 17 Apr 2016 13:33:01 +0200 Subject: [PATCH] fix for reconfig_response parameter fields sender_next_tsn, receiver_next_tsn --- gtests/net/packetdrill/run_packet.c | 8 ++++---- gtests/net/packetdrill/sctp_packet.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gtests/net/packetdrill/run_packet.c b/gtests/net/packetdrill/run_packet.c index e93c4dca..1de0d97a 100644 --- a/gtests/net/packetdrill/run_packet.c +++ b/gtests/net/packetdrill/run_packet.c @@ -774,7 +774,7 @@ static int map_inbound_sctp_packet( struct sctp_reconfig_response_parameter *response; response = (struct sctp_reconfig_response_parameter *)parameter; response->respsn = htonl(htonl(response->respsn) + local_diff); - if (response->length == sizeof(struct sctp_reconfig_response_parameter)) { + if (htons(response->length) == sizeof(struct sctp_reconfig_response_parameter)) { response->receiver_next_tsn = htonl(htonl(response->receiver_next_tsn) + local_diff); response->sender_next_tsn = htonl(htonl(response->sender_next_tsn) + remote_diff); } @@ -1029,9 +1029,9 @@ static int map_outbound_live_sctp_packet( struct sctp_reconfig_response_parameter *response; response = (struct sctp_reconfig_response_parameter *)parameter; response->respsn = htonl(htonl(response->respsn) + remote_diff); - if (response->length == sizeof(struct sctp_reconfig_response_parameter)) { - response->receiver_next_tsn = htonl(htonl(response->receiver_next_tsn) + local_diff); - response->sender_next_tsn = htonl(htonl(response->sender_next_tsn) + remote_diff); + if (htons(response->length) == sizeof(struct sctp_reconfig_response_parameter)) { + response->receiver_next_tsn = htonl(htonl(response->receiver_next_tsn) + remote_diff); + response->sender_next_tsn = htonl(htonl(response->sender_next_tsn) + local_diff); } break; } diff --git a/gtests/net/packetdrill/sctp_packet.h b/gtests/net/packetdrill/sctp_packet.h index 74f93229..8a1a4bec 100644 --- a/gtests/net/packetdrill/sctp_packet.h +++ b/gtests/net/packetdrill/sctp_packet.h @@ -1,3 +1,4 @@ + /* * Copyright 2015 Michael Tuexen * -- GitLab