summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-11-20 15:19:38 +1100
committerDamien Miller <djm@mindrot.org>2010-11-20 15:19:38 +1100
commit0dac6fb6b228a96f4ab3717e3d73871595a291a8 (patch)
tree7eae6f1e6a39fb7d608a05250f4749a77a914814 /readconf.c
parent4499f4cc20eee7e0f67b35f5a5c6078bf07dcbc0 (diff)
- djm@cvs.openbsd.org 2010/11/13 23:27:51
[clientloop.c misc.c misc.h packet.c packet.h readconf.c readconf.h] [servconf.c servconf.h session.c ssh.c ssh_config.5 sshd_config.5] allow ssh and sshd to set arbitrary TOS/DSCP/QoS values instead of hardcoding lowdelay/throughput. bz#1733 patch from philipp AT redfish-solutions.com; ok markus@ deraadt@
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index da7efd193..eb4a8b9ee 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.189 2010/09/22 05:01:29 djm Exp $ */ 1/* $OpenBSD: readconf.c,v 1.190 2010/11/13 23:27:50 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -19,6 +19,8 @@
19#include <sys/socket.h> 19#include <sys/socket.h>
20 20
21#include <netinet/in.h> 21#include <netinet/in.h>
22#include <netinet/in_systm.h>
23#include <netinet/ip.h>
22 24
23#include <ctype.h> 25#include <ctype.h>
24#include <errno.h> 26#include <errno.h>
@@ -132,7 +134,7 @@ typedef enum {
132 oHashKnownHosts, 134 oHashKnownHosts,
133 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, 135 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
134 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, 136 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication,
135 oKexAlgorithms, 137 oKexAlgorithms, oIPQoS,
136 oDeprecated, oUnsupported 138 oDeprecated, oUnsupported
137} OpCodes; 139} OpCodes;
138 140
@@ -242,6 +244,7 @@ static struct {
242 { "zeroknowledgepasswordauthentication", oUnsupported }, 244 { "zeroknowledgepasswordauthentication", oUnsupported },
243#endif 245#endif
244 { "kexalgorithms", oKexAlgorithms }, 246 { "kexalgorithms", oKexAlgorithms },
247 { "ipqos", oIPQoS },
245 248
246 { NULL, oBadOption } 249 { NULL, oBadOption }
247}; 250};
@@ -973,6 +976,23 @@ parse_int:
973 intptr = &options->visual_host_key; 976 intptr = &options->visual_host_key;
974 goto parse_flag; 977 goto parse_flag;
975 978
979 case oIPQoS:
980 arg = strdelim(&s);
981 if ((value = parse_ipqos(arg)) == -1)
982 fatal("%s line %d: Bad IPQoS value: %s",
983 filename, linenum, arg);
984 arg = strdelim(&s);
985 if (arg == NULL)
986 value2 = value;
987 else if ((value2 = parse_ipqos(arg)) == -1)
988 fatal("%s line %d: Bad IPQoS value: %s",
989 filename, linenum, arg);
990 if (*activep) {
991 options->ip_qos_interactive = value;
992 options->ip_qos_bulk = value2;
993 }
994 break;
995
976 case oUseRoaming: 996 case oUseRoaming:
977 intptr = &options->use_roaming; 997 intptr = &options->use_roaming;
978 goto parse_flag; 998 goto parse_flag;
@@ -1135,6 +1155,8 @@ initialize_options(Options * options)
1135 options->use_roaming = -1; 1155 options->use_roaming = -1;
1136 options->visual_host_key = -1; 1156 options->visual_host_key = -1;
1137 options->zero_knowledge_password_authentication = -1; 1157 options->zero_knowledge_password_authentication = -1;
1158 options->ip_qos_interactive = -1;
1159 options->ip_qos_bulk = -1;
1138} 1160}
1139 1161
1140/* 1162/*
@@ -1289,6 +1311,10 @@ fill_default_options(Options * options)
1289 options->visual_host_key = 0; 1311 options->visual_host_key = 0;
1290 if (options->zero_knowledge_password_authentication == -1) 1312 if (options->zero_knowledge_password_authentication == -1)
1291 options->zero_knowledge_password_authentication = 0; 1313 options->zero_knowledge_password_authentication = 0;
1314 if (options->ip_qos_interactive == -1)
1315 options->ip_qos_interactive = IPTOS_LOWDELAY;
1316 if (options->ip_qos_bulk == -1)
1317 options->ip_qos_bulk = IPTOS_THROUGHPUT;
1292 /* options->local_command should not be set by default */ 1318 /* options->local_command should not be set by default */
1293 /* options->proxy_command should not be set by default */ 1319 /* options->proxy_command should not be set by default */
1294 /* options->user will be set in the main program if appropriate */ 1320 /* options->user will be set in the main program if appropriate */