summaryrefslogtreecommitdiff
path: root/lib/getproto.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/getproto.c')
-rw-r--r--lib/getproto.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/getproto.c b/lib/getproto.c
index 9714da26a8241..5a8dae30b18ea 100644
--- a/lib/getproto.c
+++ b/lib/getproto.c
@@ -1,15 +1,16 @@
/*
- * Copyright (C) 2002-2005 by Darren Reed.
- *
- * See the IPFILTER.LICENCE file for details on licencing.
- *
- * $Id: getproto.c,v 1.2.2.3 2006/06/16 17:21:00 darrenr Exp $
- */
+ * Copyright (C) 2012 by Darren Reed.
+ *
+ * See the IPFILTER.LICENCE file for details on licencing.
+ *
+ * $Id$
+ */
#include "ipf.h"
+#include <ctype.h>
int getproto(name)
-char *name;
+ char *name;
{
struct protoent *p;
char *s;
@@ -23,10 +24,13 @@ char *name;
#ifdef _AIX51
/*
* For some bogus reason, "ip" is 252 in /etc/protocols on AIX 5
+ * The IANA has doubled up on the definition of 0 - it is now also
+ * used for IPv6 hop-opts, so we can no longer rely on /etc/protocols
+ * providing the correct name->number mapping
*/
+#endif
if (!strcasecmp(name, "ip"))
return 0;
-#endif
p = getprotobyname(name);
if (p != NULL)