[openssh-commits] [openssh] 01/01: Check if IP_TOS is defined before using.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 1 13:43:19 AEDT 2019


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit d500b59a825f6a58f2abf7b04eb1992d81e45d58
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Nov 1 13:42:12 2019 +1100

    Check if IP_TOS is defined before using.
---
 regress/netcat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/regress/netcat.c b/regress/netcat.c
index 56bd09de..2d86818e 100644
--- a/regress/netcat.c
+++ b/regress/netcat.c
@@ -1181,11 +1181,13 @@ set_common_sockopts(int s)
 			&x, sizeof(x)) == -1)
 			err(1, "setsockopt");
 	}
+#ifdef IP_TOS
 	if (Tflag != -1) {
 		if (setsockopt(s, IPPROTO_IP, IP_TOS,
 		    &Tflag, sizeof(Tflag)) == -1)
 			err(1, "set IP ToS");
 	}
+#endif
 	if (Iflag) {
 		if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
 		    &Iflag, sizeof(Iflag)) == -1)
@@ -1201,6 +1203,7 @@ set_common_sockopts(int s)
 int
 map_tos(char *s, int *val)
 {
+#ifdef IP_TOS
 	/* DiffServ Codepoints and other TOS mappings */
 	const struct toskeywords {
 		const char	*keyword;
@@ -1242,6 +1245,7 @@ map_tos(char *s, int *val)
 			return (1);
 		}
 	}
+#endif
 
 	return (0);
 }

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list