diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-10-25 23:02:17 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-10-25 23:02:17 -0700 |
| commit | f9ff44ce0f0c73f05c182bb07c76bf6b51470560 (patch) | |
| tree | bc37e151ab8527ca6df85ccb079c2b03673ba319 /src/sp/transport/dtls | |
| parent | c2aa8c12e705ba77f3d2d28c5ba0a9ec7efb7632 (diff) | |
| download | nng-f9ff44ce0f0c73f05c182bb07c76bf6b51470560.tar.gz nng-f9ff44ce0f0c73f05c182bb07c76bf6b51470560.tar.bz2 nng-f9ff44ce0f0c73f05c182bb07c76bf6b51470560.zip | |
Plumb sockaddrs all the way through pipes, make them failsafe.
These functions can no longer fail.
Diffstat (limited to 'src/sp/transport/dtls')
| -rw-r--r-- | src/sp/transport/dtls/dtls.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sp/transport/dtls/dtls.c b/src/sp/transport/dtls/dtls.c index 400709a1..ff78709d 100644 --- a/src/sp/transport/dtls/dtls.c +++ b/src/sp/transport/dtls/dtls.c @@ -1077,6 +1077,19 @@ dtls_pipe_peer_cert(void *arg, nng_tls_cert **certp) return (nni_tls_peer_cert(&p->tls, certp)); } +static const nng_sockaddr * +dtls_pipe_peer_addr(void *arg) +{ + dtls_pipe *p = arg; + return (&p->peer_addr); +} + +static const nng_sockaddr * +dtls_pipe_self_addr(void *arg) +{ + dtls_pipe *p = arg; + return (&p->ep->self_sa); +} static void dtls_ep_fini(void *arg) @@ -1694,6 +1707,8 @@ static nni_sp_pipe_ops dtls_pipe_ops = { .p_peer = dtls_pipe_peer, .p_getopt = dtls_pipe_getopt, .p_peer_cert = dtls_pipe_peer_cert, + .p_peer_addr = dtls_pipe_peer_addr, + .p_self_addr = dtls_pipe_self_addr, }; static const nni_option dtls_ep_opts[] = { |
