aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-m3ua.c
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-07-19 21:22:43 -0400
committerRoland Knall <rknall@gmail.com>2022-07-20 13:59:56 +0000
commit3a57dd522bbabc427f99f06d8f284b2d07c0f4e5 (patch)
tree7a41ae6a01d9a39bb44a7256c437f16ed2ae29ee /epan/dissectors/packet-m3ua.c
parentbf89153aa0a29ded302bd42db3dfd13687842b3c (diff)
Use WS_ROUNDUP_4 in more dissectors
Several more dissectors define their own "round up the length to a 4 byte word boundary" macros. Use the new common macro in wsutil/ws_roundup.h instead.
Diffstat (limited to 'epan/dissectors/packet-m3ua.c')
-rw-r--r--epan/dissectors/packet-m3ua.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c
index ab2049e784..377ed8e089 100644
--- a/epan/dissectors/packet-m3ua.c
+++ b/epan/dissectors/packet-m3ua.c
@@ -25,6 +25,7 @@
#include <epan/address_types.h>
#include <epan/sctpppids.h>
#include <wsutil/str_util.h>
+#include <wsutil/ws_roundup.h>
#include "packet-mtp3.h"
#include "packet-sccp.h"
#include "packet-frame.h"
@@ -37,7 +38,6 @@ void proto_reg_handoff_m3ua(void);
static gint m3ua_pref_mtp3_standard;
#define SCTP_PORT_M3UA 2905
-#define ADD_PADDING(x) ((((x) + 3) >> 2) << 2)
#define VERSION_LENGTH 1
#define RESERVED_LENGTH 1
@@ -1948,7 +1948,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
offset = 0;
while((remaining_length = tvb_reported_length_remaining(parameters_tvb, offset))) {
length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET);
- total_length = ADD_PADDING(length);
+ total_length = WS_ROUNDUP_4(length);
if (remaining_length >= length)
total_length = MIN(total_length, remaining_length);
/* create a tvb for the parameter including the padding bytes */