summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2011-09-06 09:45:52 +0100
committerColin Watson <cjwatson@debian.org>2011-09-06 09:45:52 +0100
commitf38224d546cdde55f45c13d3d8225d273a3f920e (patch)
treea91a26b88ac90dc72d0ea3767feabb341eaa50a8 /misc.c
parent338146a3fc257e216fe5c10fe40e6896b40d7739 (diff)
parente90790abaf031e037f444a6658e136e48577ea49 (diff)
merge 5.9p1
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index 919b04e6b..5f63090d9 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.84 2010/11/21 01:01:13 djm Exp $ */ 1/* $OpenBSD: misc.c,v 1.85 2011/03/29 18:54:17 stevesk Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -985,6 +985,19 @@ parse_ipqos(const char *cp)
985 return val; 985 return val;
986} 986}
987 987
988const char *
989iptos2str(int iptos)
990{
991 int i;
992 static char iptos_str[sizeof "0xff"];
993
994 for (i = 0; ipqos[i].name != NULL; i++) {
995 if (ipqos[i].value == iptos)
996 return ipqos[i].name;
997 }
998 snprintf(iptos_str, sizeof iptos_str, "0x%02x", iptos);
999 return iptos_str;
1000}
988void 1001void
989sock_set_v6only(int s) 1002sock_set_v6only(int s)
990{ 1003{