diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/netcat.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) | |||
1181 | &x, sizeof(x)) == -1) | 1181 | &x, sizeof(x)) == -1) |
1182 | err(1, "setsockopt"); | 1182 | err(1, "setsockopt"); |
1183 | } | 1183 | } |
1184 | #ifdef IP_TOS | ||
1184 | if (Tflag != -1) { | 1185 | if (Tflag != -1) { |
1185 | if (setsockopt(s, IPPROTO_IP, IP_TOS, | 1186 | if (setsockopt(s, IPPROTO_IP, IP_TOS, |
1186 | &Tflag, sizeof(Tflag)) == -1) | 1187 | &Tflag, sizeof(Tflag)) == -1) |
1187 | err(1, "set IP ToS"); | 1188 | err(1, "set IP ToS"); |
1188 | } | 1189 | } |
1190 | #endif | ||
1189 | if (Iflag) { | 1191 | if (Iflag) { |
1190 | if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, | 1192 | if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, |
1191 | &Iflag, sizeof(Iflag)) == -1) | 1193 | &Iflag, sizeof(Iflag)) == -1) |
@@ -1201,6 +1203,7 @@ set_common_sockopts(int s) | |||
1201 | int | 1203 | int |
1202 | map_tos(char *s, int *val) | 1204 | map_tos(char *s, int *val) |
1203 | { | 1205 | { |
1206 | #ifdef IP_TOS | ||
1204 | /* DiffServ Codepoints and other TOS mappings */ | 1207 | /* DiffServ Codepoints and other TOS mappings */ |
1205 | const struct toskeywords { | 1208 | const struct toskeywords { |
1206 | const char *keyword; | 1209 | const char *keyword; |
@@ -1242,6 +1245,7 @@ map_tos(char *s, int *val) | |||
1242 | return (1); | 1245 | return (1); |
1243 | } | 1246 | } |
1244 | } | 1247 | } |
1248 | #endif | ||
1245 | 1249 | ||
1246 | return (0); | 1250 | return (0); |
1247 | } | 1251 | } |