[riot-notifications] [RIOT-OS/RIOT] pkg/tinydtls: set endpoint of session after complete handshake (#15450)

Aiman Ismail notifications at github.com
Tue Nov 17 12:16:33 CET 2020


@pokgak approved this pull request.

LGTM. ACK.

Server log without PR:
```
main(): This is RIOT! (Version: 2021.01-devel-916-g5d997)
DTLS sock example application
All up, running the shell now
> dtlss start
dtlss start
> ifconfig
ifconfig
Iface  6  HWaddr: 1A:A2:86:BD:C0:12
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::18a2:86ff:febd:c012  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ffbd:c012

> Session handshake received
Session.ep.family: AF_UNSPEC
Session.ep.addr: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:
New client connected
Session became ready
Received 4 bytes -- (echo)
Session was destroyed by peer
```

Server log with PR:
```
main(): This is RIOT! (Version: 2021.01-devel-906-g2538e-pr/tinydtls_fix_handshake_session)                                                                                                                                                                                                                          
DTLS sock example application                                                                                                                                                                                                                                                                                        
All up, running the shell now                                                                                                                                                                                                                                                                                        
> dtlss start                                                                                                                                                                                                                                                                                                        
dtlss start                                                                                                                                                                                                                                                                                                          
> Session handshake received                                                                                                                                                                                                                                                                                         
Session.ep.family: AF_INET6                                                                                                                                                                                                                                                                                          
Session.ep.addr: FE:80:00:00:00:00:00:00:A4:D5:BF:FF:FE:3E:41:45:                                                                                                                                                                                                                                                    
New client connected                                                                                                                                                                                                                                                                                                 
Session became ready
Received 4 bytes -- (echo)
Session was destroyed by peer
```

Note that this issue does not happen with the non-async version (`example/dtls-sock`)  because the call to `sock_udp_recv()` in the [next line](https://github.com/RIOT-OS/RIOT/blob/2f8460a4578cd568c780d4f6173e44795380af8c/pkg/tinydtls/contrib/sock_dtls.c#L531-L532) sets the ep for us. 



-- 
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/15450#pullrequestreview-532259810
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201117/d4484455/attachment.htm>


More information about the notifications mailing list