aboutsummaryrefslogtreecommitdiff
path: root/src/telnet.c
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2016-01-17 21:50:36 -0500
committerFranklin Wei <git@fwei.tk>2016-01-17 21:50:36 -0500
commit17ca1e8e354572f68f0e369431fcfcf3249b93ae (patch)
tree263507309fa4bff8f34902d2600bcaa64fbb53b3 /src/telnet.c
parente9d88b79ada4a5d544a36a28cc68a1254ca0a97b (diff)
downloadnetcosm-17ca1e8e354572f68f0e369431fcfcf3249b93ae.zip
netcosm-17ca1e8e354572f68f0e369431fcfcf3249b93ae.tar.gz
netcosm-17ca1e8e354572f68f0e369431fcfcf3249b93ae.tar.bz2
netcosm-17ca1e8e354572f68f0e369431fcfcf3249b93ae.tar.xz
remember last login
Diffstat (limited to 'src/telnet.c')
-rw-r--r--src/telnet.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/telnet.c b/src/telnet.c
index 9e664ea..12c9533 100644
--- a/src/telnet.c
+++ b/src/telnet.c
@@ -46,7 +46,8 @@ int telnet_handle_command(const unsigned char *buf)
{ ECHO, "ECHO" },
{ SGA, "SGA" },
{ STATUS, "STATUS" },
- { NAWS, "NAWS" }
+ { NAWS, "NAWS" },
+ { IP, "IP" },
};
for(unsigned int i = 0; i < ARRAYLEN(commands); ++i)
@@ -55,16 +56,11 @@ int telnet_handle_command(const unsigned char *buf)
{
debugf("%s ", commands[i].name);
cmd = true;
+ if(c == IP)
+ return TELNET_EXIT;
goto found;
}
}
- switch(c)
- {
- case IP:
- return TELNET_EXIT;
- default:
- break;
- }
debugf("???: %d ", c);
found: