aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2023-07-27 15:01:05 +0100
committerJoão Valverde <j@v6e.pt>2023-07-27 15:40:29 +0100
commit734a675938818f654254333df0ad5535ca7bbe7a (patch)
tree9be876d4cd96eafa40a86a632afe4570f6354511 /epan/addr_resolv.c
parenta3142d25bf805d9a77fa238cf29d34e75b8a1bae (diff)
Add description to IANA services table
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r--epan/addr_resolv.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index 4d81696df0..1016445f1e 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -838,6 +838,7 @@ serv_name_lookup(port_type proto, guint port)
serv_port_t *serv_port_table = NULL;
const char *name;
ws_services_proto_t p;
+ ws_services_entry_t *serv;
/* first look in the personal services file + cache */
name = _serv_name_lookup(proto, port, &serv_port_table);
@@ -845,20 +846,20 @@ serv_name_lookup(port_type proto, guint port)
return name;
/* now look in the global tables */
- switch( proto) {
+ switch(proto) {
case PT_TCP: p = ws_tcp; break;
case PT_UDP: p = ws_udp; break;
case PT_SCTP: p = ws_sctp; break;
case PT_DCCP: p = ws_dccp; break;
default: ws_assert_not_reached();
}
- name = global_services_lookup(port, p);
- if (name) {
+ serv = global_services_lookup(port, p);
+ if (serv) {
/* Cache result */
/* XXX would be nice to avoid the strdup for this name static string but user/custom entries
* are dynamic and they share the same table. */
- add_service_name(proto, port, name);
- return name;
+ add_service_name(proto, port, serv->name);
+ return serv->name;
}
if (serv_port_table == NULL) {