aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ConfigureChecks.cmake1
-rw-r--r--cmakeconfig.h.in3
-rw-r--r--configure.ac1
-rw-r--r--epan/ipproto.c26
4 files changed, 1 insertions, 30 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 01d4b74..4e2f0a0 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -108,7 +108,6 @@ if(HAVE_GETOPT_LONG)
check_symbol_exists("optreset" HAVE_OPTRESET)
endif()
endif()
-check_function_exists("getprotobynumber" HAVE_GETPROTOBYNUMBER)
check_function_exists("getifaddrs" HAVE_GETIFADDRS)
check_function_exists("issetugid" HAVE_ISSETUGID)
check_function_exists("mkdtemp" HAVE_MKDTEMP)
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index 085dbc3..ec715ce 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -95,9 +95,6 @@
/* Define to 1 if you have the <getopt.h> header file. */
#cmakedefine HAVE_GETOPT_H 1
-/* Define to 1 if you have the `getprotobynumber' function. */
-#cmakedefine HAVE_GETPROTOBYNUMBER 1
-
/* Define to 1 if you have the <grp.h> header file. */
#cmakedefine HAVE_GRP_H 1
diff --git a/configure.ac b/configure.ac
index e13496c..6147d08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2347,7 +2347,6 @@ AC_REPLACE_FUNCS(strptime)
AC_REPLACE_FUNCS(popcount)
AC_CHECK_FUNCS(mkstemps mkdtemp)
-AC_CHECK_FUNCS(getprotobynumber)
AC_CHECK_FUNCS(issetugid)
AC_CHECK_FUNCS(sysconf)
AC_CHECK_FUNCS(getifaddrs)
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 */