[riot-notifications] [RIOT-OS/RIOT] sys/net/application_layer: add telnet server module & example (#16723)

Martine Lenders notifications at github.com
Tue Sep 7 13:35:11 CEST 2021


@miri64 commented on this pull request.

I tried to test this, but when I try to connect to the native instance using

```sh
telnet fe80::e0bc:7dff:fecb:f550%tapbr0
```

I don't get any output at the `telnet` client. Output at the shell still works:

```
RIOT telnet example application
╔═══════════════════════════════════════════════════╗
║telnet is entirely unencrypted and unauthenticated.║
║Do not use this on public networks.                ║
╚═══════════════════════════════════════════════════╝
My address is fe80::e0bc:7dff:fecb:f550
All up, awaiting connection on port 23
> ps
ps
	pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
	  - | isr_stack            | -        - |   - |   8192 (   -1) ( 8193) | 0x56659820 | 0x56659820
	  1 | idle                 | pending  Q |  15 |   8192 (  436) ( 7756) | 0x56652120 | 0x56653f80 
	  2 | main                 | running  Q |   7 |  12288 ( 3020) ( 9268) | 0x56654120 | 0x56656f80 
	  3 | ipv6                 | bl rx    _ |   4 |   8192 ( 1440) ( 6752) | 0x5665dbc0 | 0x5665fa20 
	  4 | gnrc_tcp             | bl rx    _ |   5 |   8192 (  912) ( 7280) | 0x566638a0 | 0x56665700 
	  5 | gnrc_netdev_tap      | bl rx    _ |   2 |   8192 ( 2476) ( 5716) | 0x5665ffe0 | 0x56661e40 
	  6 | telnet               | bl mbox  _ |   6 |   8192 ( 1168) ( 7024) | 0x566664c0 | 0x56668320 
	    | SUM                  |            |     |  61440 ( 9452) (51988)
> ps
ps
	pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
	  - | isr_stack            | -        - |   - |   8192 (   -1) ( 8193) | 0x56659820 | 0x56659820
	  1 | idle                 | pending  Q |  15 |   8192 (  436) ( 7756) | 0x56652120 | 0x56653f80 
	  2 | main                 | running  Q |   7 |  12288 ( 3020) ( 9268) | 0x56654120 | 0x56656f80 
	  3 | ipv6                 | bl rx    _ |   4 |   8192 ( 1648) ( 6544) | 0x5665dbc0 | 0x5665fa20 
	  4 | gnrc_tcp             | bl rx    _ |   5 |   8192 ( 1552) ( 6640) | 0x566638a0 | 0x56665700 
	  5 | gnrc_netdev_tap      | bl rx    _ |   2 |   8192 ( 2476) ( 5716) | 0x5665ffe0 | 0x56661e40 
	  6 | telnet               | bl mbox  _ |   6 |   8192 ( 1728) ( 6464) | 0x566664c0 | 0x56668320 
	    | SUM                  |            |     |  61440 (10860) (50580)
```

First `ps` was before connecting the client, second after. When I disconnect the client, it hangs on another `ps`. Here is my `gdb` output (with `gdb-dashboard` :wink:):

```
> ps
^C
Program received signal SIGINT, Interrupt.
0xf7fcb549 in __kernel_vsyscall ()
where
─── Assembly ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 0xf7fcb549  ? pop    %ebp
 0xf7fcb54a  ? pop    %edx
 0xf7fcb54b  ? pop    %ecx
 0xf7fcb54c  ? ret    
 0xf7fcb54d  ? nop
 0xf7fcb54e  ? nop
 0xf7fcb54f  ? nop
 0xf7fcb550  ? nop
 0xf7fcb551  ? lea    0x0(%esi,%eiz,1),%esi
 0xf7fcb558  ? lea    0x0(%esi,%eiz,1),%esi
─── Breakpoints ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── Expressions ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── History ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── Memory ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── Registers ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      eax 0x00000000       ecx 0x5658f820       edx 0x00000000       ebx 0x00000002       esp 0x5659c090       ebp 0x5659c4e0       esi 0x00000008       edi 0x5659c594       eip 0xf7fcb549      eflags [ PF SF IF ]      cs 0x00000023
       ss 0x0000002b        ds 0x0000002b        es 0x0000002b        fs 0x00000000        gs 0x00000063
─── Source ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── Stack ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[0] from 0xf7fcb549 in __kernel_vsyscall
[1] from 0xf7d52a26 in pthread_sigmask at GLIBC_2.0
[2] from 0xf7d05974 in sigprocmask
[3] from 0x56559504 in irq_disable+58 at /home/mlenders/Repositories/RIOT-OS/RIOT/cpu/native/irq_cpu.c:160
[4] from 0x56558656 in mutex_lock+39 at /home/mlenders/Repositories/RIOT-OS/RIOT/core/mutex.c:73
[5] from 0x565689d5 in _gnrc_tcp_fsm_get_state+45 at /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/gnrc/transport_layer/tcp/gnrc_tcp_fsm.c:1005
[6] from 0x5656975c in gnrc_tcp_recv+158 at /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c:816
[7] from 0x56566d7d in sock_tcp_read+63 at /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/gnrc/sock/tcp/gnrc_sock_tcp.c:133
[8] from 0x565723eb in telnet_thread+265 at /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/application_layer/telnet/telnet_server.c:160
[9] from 0xf7d19499 in makecontext
[+]
─── Threads ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[1] id 81309 name telnet_server.e from 0xf7fcb549 in __kernel_vsyscall
─── Variables ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
>>> where
#0  0xf7fcb549 in __kernel_vsyscall ()
#1  0xf7d52a26 in pthread_sigmask at GLIBC_2.0 () from /usr/lib32/libc.so.6
#2  0xf7d05974 in sigprocmask () from /usr/lib32/libc.so.6
#3  0x56559504 in irq_disable () at /home/mlenders/Repositories/RIOT-OS/RIOT/cpu/native/irq_cpu.c:160
#4  0x56558656 in mutex_lock (mutex=0x5659c594 <socks+180>) at /home/mlenders/Repositories/RIOT-OS/RIOT/core/mutex.c:73
#5  0x565689d5 in _gnrc_tcp_fsm_get_state (tcb=0x5659c4e0 <socks>) at /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/gnrc/transport_layer/tcp/gnrc_tcp_fsm.c:1005
#6  0x5656975c in gnrc_tcp_recv (tcb=0x5659c4e0 <socks>, data=0x5659a460 <rx_buf>, max_len=64, timeout_duration_ms=50) at /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c:816
#7  0x56566d7d in sock_tcp_read (sock=0x5659c4e0 <socks>, data=0x5659a460 <rx_buf>, max_len=64, timeout=50) at /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/gnrc/sock/tcp/gnrc_sock_tcp.c:133
#8  0x565723eb in telnet_thread (arg=0x0) at /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/application_layer/telnet/telnet_server.c:160
#9  0xf7d19499 in makecontext () from /usr/lib32/libc.so.6
#10 0x00000000 in ?? ()
```





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16723#pullrequestreview-747868646
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210907/74746316/attachment-0001.htm>


More information about the notifications mailing list