diff options
Diffstat (limited to 'contrib/telnet/telnetd/telnetd.c')
-rw-r--r-- | contrib/telnet/telnetd/telnetd.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/telnet/telnetd/telnetd.c b/contrib/telnet/telnetd/telnetd.c index 6e4bd4f..614bab9 100644 --- a/contrib/telnet/telnetd/telnetd.c +++ b/contrib/telnet/telnetd/telnetd.c @@ -131,12 +131,14 @@ char user_name[256]; int main(int argc, char *argv[]) { + u_long ultmp; struct sockaddr_storage from; int on = 1, fromlen; int ch; #if defined(IPPROTO_IP) && defined(IP_TOS) int tos = -1; #endif + char *ep; pfrontp = pbackp = ptyobuf; netip = netibuf; @@ -273,7 +275,14 @@ main(int argc, char *argv[]) "bad TOS argument '", optarg, "'; will try to use default TOS"); #else - warnx("TOS option unavailable; -S flag not supported"); +#define MAXTOS 255 + ultmp = strtoul(optarg, &ep, 0); + if (*ep || ep == optarg || ultmp > MAXTOS) + warnx("%s%s%s", + "bad TOS argument '", optarg, + "'; will try to use default TOS"); + else + tos = ultmp; #endif break; |