aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ipproto.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/ipproto.c')
-rw-r--r--epan/ipproto.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/epan/ipproto.c b/epan/ipproto.c
index f328bf5..97ed2d8 100644
--- a/epan/ipproto.c
+++ b/epan/ipproto.c
@@ -269,31 +269,7 @@ static const value_string ipproto_val[] = {
value_string_ext ipproto_val_ext = VALUE_STRING_EXT_INIT(ipproto_val);
const char *ipprotostr(const int proto) {
- const char *s;
-
- if ((s = try_val_to_str_ext(proto, &ipproto_val_ext)) != NULL)
- return s;
-
- s = "Unknown";
-
-#ifdef HAVE_GETPROTOBYNUMBER
- /*
- * XXX - have another flag for resolving network-layer
- * protocol names?
- */
- if (gbl_resolv_flags.mac_name || gbl_resolv_flags.network_name ||
- gbl_resolv_flags.transport_name) {
- static char buf[128];
- struct protoent *pe;
-
- pe = getprotobynumber(proto);
- if (pe) {
- g_strlcpy(buf, pe->p_name, sizeof(buf));
- s = buf;
- }
- }
-#endif
- return s;
+ return val_to_str_ext_const(proto, &ipproto_val_ext, "Unknown");
}
/* https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#extension-header */