aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-quake2.c
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-08-05 08:03:39 -0400
committerJohn Thacker <johnthacker@gmail.com>2022-08-05 08:04:43 -0400
commite43c6b1aa267aa8b23dea08158f2cb7046b50778 (patch)
treee2e7e3eb8b2a05960a632dc0d8633cbbd32038f4 /epan/dissectors/packet-quake2.c
parent0aed38cf971204b4cf36ddd05cabb39780efb2a8 (diff)
quake2, quakeworld: Get ports as ranges
quake2 and quakeworld get the port list to use to determine client/server. Get that as a range now. Ping #14319.
Diffstat (limited to 'epan/dissectors/packet-quake2.c')
-rw-r--r--epan/dissectors/packet-quake2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-quake2.c b/epan/dissectors/packet-quake2.c
index aa812f537d..e75a0c527f 100644
--- a/epan/dissectors/packet-quake2.c
+++ b/epan/dissectors/packet-quake2.c
@@ -69,7 +69,7 @@ static gint ett_quake2_game_clc_cmd_move_moves = -1;
#define PORT_MASTER 27910 /* Not IANA registered */
-static guint gbl_quake2ServerPort=PORT_MASTER;
+static range_t *gbl_quake2ServerPorts = NULL;
static void
@@ -556,7 +556,7 @@ dissect_quake2_GamePacket(tvbuff_t *tvb, packet_info *pinfo,
int offset;
guint rest_length;
- direction = (pinfo->destport == gbl_quake2ServerPort) ?
+ direction = value_is_in_range(gbl_quake2ServerPorts, pinfo->destport) ?
DIR_C2S : DIR_S2C;
game_tree = proto_tree_add_subtree(tree, tvb,
@@ -629,7 +629,7 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
proto_tree *quake2_tree = NULL;
int direction;
- direction = (pinfo->destport == gbl_quake2ServerPort) ?
+ direction = value_is_in_range(gbl_quake2ServerPorts, pinfo->destport) ?
DIR_C2S : DIR_S2C;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "QUAKE2");
@@ -674,7 +674,7 @@ static void
apply_quake2_prefs(void)
{
/* Port preference used to determine client/server */
- gbl_quake2ServerPort = prefs_get_uint_value("quake2", "udp.port");
+ gbl_quake2ServerPorts = prefs_get_range_value("quake2", "udp.port");
}
void