mirror of
https://github.com/clearml/dropbear
synced 2025-01-31 02:46:58 +00:00
Make IP Type-Of-Service feature optional
Add new -z commandline option which when set, disables new IP TOS feature. References: https://github.com/openwrt/openwrt/issues/10405 Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
parent
0e70732e1e
commit
2864c3d154
@ -98,6 +98,7 @@ static void printhelp() {
|
|||||||
#if DEBUG_TRACE
|
#if DEBUG_TRACE
|
||||||
"-v verbose (repeat for more verbose)\n"
|
"-v verbose (repeat for more verbose)\n"
|
||||||
#endif
|
#endif
|
||||||
|
"-z disable IP Type-Of-Service feature\n"
|
||||||
,DROPBEAR_VERSION, cli_opts.progname,
|
,DROPBEAR_VERSION, cli_opts.progname,
|
||||||
#if DROPBEAR_CLI_PUBKEY_AUTH
|
#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||||
DROPBEAR_DEFAULT_CLI_AUTHKEY,
|
DROPBEAR_DEFAULT_CLI_AUTHKEY,
|
||||||
@ -325,6 +326,9 @@ void cli_getopts(int argc, char ** argv) {
|
|||||||
case 'b':
|
case 'b':
|
||||||
next = &bind_arg;
|
next = &bind_arg;
|
||||||
break;
|
break;
|
||||||
|
case 'z':
|
||||||
|
opts.disable_ip_tos = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"WARNING: Ignoring unknown option -%c\n", c);
|
"WARNING: Ignoring unknown option -%c\n", c);
|
||||||
|
3
netio.c
3
netio.c
@ -3,6 +3,7 @@
|
|||||||
#include "dbutil.h"
|
#include "dbutil.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "runopts.h"
|
||||||
|
|
||||||
struct dropbear_progress_connection {
|
struct dropbear_progress_connection {
|
||||||
struct addrinfo *res;
|
struct addrinfo *res;
|
||||||
@ -377,6 +378,7 @@ void set_sock_priority(int sock, enum dropbear_prio prio) {
|
|||||||
/* Don't log ENOTSOCK errors so that this can harmlessly be called
|
/* Don't log ENOTSOCK errors so that this can harmlessly be called
|
||||||
* on a client '-J' proxy pipe */
|
* on a client '-J' proxy pipe */
|
||||||
|
|
||||||
|
if (opts.disable_ip_tos == 0) {
|
||||||
#ifdef IP_TOS
|
#ifdef IP_TOS
|
||||||
/* Set the DSCP field for outbound IP packet priority.
|
/* Set the DSCP field for outbound IP packet priority.
|
||||||
rfc4594 has some guidance to meanings.
|
rfc4594 has some guidance to meanings.
|
||||||
@ -409,6 +411,7 @@ void set_sock_priority(int sock, enum dropbear_prio prio) {
|
|||||||
TRACE(("Couldn't set IP_TOS (%s)", strerror(errno)));
|
TRACE(("Couldn't set IP_TOS (%s)", strerror(errno)));
|
||||||
}
|
}
|
||||||
#endif /* IP_TOS */
|
#endif /* IP_TOS */
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LINUX_PKT_SCHED_H
|
#ifdef HAVE_LINUX_PKT_SCHED_H
|
||||||
/* Set scheduling priority within the local Linux network stack */
|
/* Set scheduling priority within the local Linux network stack */
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
typedef struct runopts {
|
typedef struct runopts {
|
||||||
|
|
||||||
|
int disable_ip_tos;
|
||||||
#if DROPBEAR_SVR_REMOTETCPFWD || DROPBEAR_CLI_LOCALTCPFWD \
|
#if DROPBEAR_SVR_REMOTETCPFWD || DROPBEAR_CLI_LOCALTCPFWD \
|
||||||
|| DROPBEAR_CLI_REMOTETCPFWD
|
|| DROPBEAR_CLI_REMOTETCPFWD
|
||||||
int listen_fwd_all;
|
int listen_fwd_all;
|
||||||
|
@ -112,6 +112,7 @@ static void printhelp(const char * progname) {
|
|||||||
#if DEBUG_TRACE
|
#if DEBUG_TRACE
|
||||||
"-v verbose (repeat for more verbose)\n"
|
"-v verbose (repeat for more verbose)\n"
|
||||||
#endif
|
#endif
|
||||||
|
"-z disable IP Type-Of-Service feature\n"
|
||||||
,DROPBEAR_VERSION, progname,
|
,DROPBEAR_VERSION, progname,
|
||||||
#if DROPBEAR_DSS
|
#if DROPBEAR_DSS
|
||||||
DSS_PRIV_FILENAME,
|
DSS_PRIV_FILENAME,
|
||||||
@ -201,6 +202,7 @@ void svr_getopts(int argc, char ** argv) {
|
|||||||
#if DROPBEAR_SVR_REMOTETCPFWD
|
#if DROPBEAR_SVR_REMOTETCPFWD
|
||||||
opts.listen_fwd_all = 0;
|
opts.listen_fwd_all = 0;
|
||||||
#endif
|
#endif
|
||||||
|
opts.disable_ip_tos = 0;
|
||||||
|
|
||||||
for (i = 1; i < (unsigned int)argc; i++) {
|
for (i = 1; i < (unsigned int)argc; i++) {
|
||||||
if (argv[i][0] != '-' || argv[i][1] == '\0')
|
if (argv[i][0] != '-' || argv[i][1] == '\0')
|
||||||
@ -324,6 +326,9 @@ void svr_getopts(int argc, char ** argv) {
|
|||||||
print_version();
|
print_version();
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
break;
|
break;
|
||||||
|
case 'z':
|
||||||
|
opts.disable_ip_tos = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Invalid option -%c\n", c);
|
fprintf(stderr, "Invalid option -%c\n", c);
|
||||||
printhelp(argv[0]);
|
printhelp(argv[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user