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); }