# HG changeset patch # User gthomas # Date 1144450800 0 # Node ID 9bb18751f4b7805cf28e7a9223ad47a1b36a5699 # Parent 970f455a23974a0ce7c5e490a9885e682cc3d913 Handle TELNET_WILL (reject) - from Grant Edwards diff --git a/packages/redboot/current/ChangeLog b/packages/redboot/current/ChangeLog --- a/packages/redboot/current/ChangeLog +++ b/packages/redboot/current/ChangeLog @@ -1,3 +1,8 @@ +2006-04-07 Grant Edwards + + * src/net/net_io.c (net_io_getc_nonblock): + Handle TELNET_WILL (reject same as TELNET_DO) + 2006-04-03 Lars Povlsen * src/flash.c (fis_update_directory): Fixed flash region size when diff --git a/packages/redboot/current/src/net/net_io.c b/packages/redboot/current/src/net/net_io.c --- a/packages/redboot/current/src/net/net_io.c +++ b/packages/redboot/current/src/net/net_io.c @@ -170,8 +170,10 @@ static void net_io_putc(void*, cyg_uint8 // Special characters used by Telnet - must be interpretted here #define TELNET_IAC 0xFF // Interpret as command (escape) #define TELNET_IP 0xF4 // Interrupt process -#define TELNET_WONT 0xFC // I Won't do it +#define TELNET_WILL 0xFB // I Will do XXX +#define TELNET_WONT 0xFC // I Won't do XXX #define TELNET_DO 0xFD // Will you XXX +#define TELNET_DONT 0xFE // Don't you XXX #define TELNET_TM 0x06 // Time marker (special DO/WONT after IP) static cyg_bool @@ -248,6 +250,14 @@ net_io_getc_nonblock(void* __ch_data, cy net_io_putc(__ch_data, TELNET_WONT); net_io_putc(__ch_data, esc); return false; // Ignore this whole thing! + case TELNET_WILL: + // Telnet WILL option + while (!_net_io_getc_nonblock(__ch_data, &esc)) ; + // Respond with DONT option + net_io_putc(__ch_data, TELNET_IAC); + net_io_putc(__ch_data, TELNET_DONT); + net_io_putc(__ch_data, esc); + return false; // Ignore this whole thing! default: return false; }