diff options
author | Colin Watson <cjwatson@debian.org> | 2011-09-06 09:45:52 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2011-09-06 09:45:52 +0100 |
commit | f38224d546cdde55f45c13d3d8225d273a3f920e (patch) | |
tree | a91a26b88ac90dc72d0ea3767feabb341eaa50a8 /misc.c | |
parent | 338146a3fc257e216fe5c10fe40e6896b40d7739 (diff) | |
parent | e90790abaf031e037f444a6658e136e48577ea49 (diff) |
merge 5.9p1
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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 | ||
988 | const char * | ||
989 | iptos2str(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 | } | ||
988 | void | 1001 | void |
989 | sock_set_v6only(int s) | 1002 | sock_set_v6only(int s) |
990 | { | 1003 | { |