From: Darren Tucker Date: Fri, 1 Nov 2019 02:42:12 +0000 (+1100) Subject: Check if IP_TOS is defined before using. X-Git-Tag: V_8_2_P1~365 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d500b59a825f6a58f2abf7b04eb1992d81e45d58;p=thirdparty%2Fopenssh-portable.git Check if IP_TOS is defined before using. --- diff --git a/regress/netcat.c b/regress/netcat.c index 56bd09de5..2d86818e2 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); }