Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dtls listen using inet and inet6 without {ip,ListenIP} override record in ets dtls_listener_sup #7955

Closed
obi458 opened this issue Dec 14, 2023 · 1 comment · Fixed by #8287
Labels
bug Issue is reported as a bug priority:medium team:PS Assigned to OTP team PS
Milestone

Comments

@obi458
Copy link
Contributor

obi458 commented Dec 14, 2023

Describe the bug
When listen on same port using once inet and once inet6 without using {ip,ListenIP} will create one record in ets dtls_listener_sup

To Reproduce
1> application:ensure_all_started(ssl).
{ok,[crypto,asn1,public_key,ssl]}
2> spawn(fun() -> ssl:listen(0,[inet,{port,63450},{ciphers,[#{cipher => aes_256_gcm,key_exchange => psk,mac => aead,prf => sha384}]},{protocol,dtls},{versions,['dtlsv1.2']},{verify,verify_none},{psk_identity,"psk"}]) end).
3> spawn(fun() -> ssl:listen(0,[inet6,{ipv6_v6only,true},{port,63450},{ciphers,[#{cipher => aes_256_gcm,key_exchange => psk,mac => aead,prf => sha384}]},{protocol,dtls},{versions,['dtlsv1.2']},{verify,verify_none},{psk_identity,"psk"}]) end).

This gives in ets dtls_listener_sup
{{0,0,0,0},63450} {Pid1,Pid2}

Expected behavior
Except two records in ets dtls_listener_sup:
{{0,0,0,0},63450} {Pid1,Pid2} %inet
{{0,0,0,0,0,0,0,0},63450} {Pid3,Pid4} %inet6

Affected versions
Tested 25.x and 26.1.x

@obi458 obi458 added the bug Issue is reported as a bug label Dec 14, 2023
@IngelaAndin IngelaAndin added the team:PS Assigned to OTP team PS label Dec 18, 2023
@IngelaAndin
Copy link
Contributor

Thank you for reporting it. We will fix it but will not be top priority.

@IngelaAndin IngelaAndin added this to the OTP-27.0 milestone Dec 19, 2023
dgud added a commit to dgud/otp that referenced this issue Mar 20, 2024
IP adress always defaulted to {0,0,0,0} even for ipv6 connections,
which caused a single entry if you where listening on both stacks.

Fixes erlang#7955
dgud added a commit to dgud/otp that referenced this issue Mar 21, 2024
IP adress always defaulted to {0,0,0,0} even for ipv6 connections,
which caused a single entry if you where listening on both stacks.

Fixes erlang#7955
dgud added a commit that referenced this issue Mar 26, 2024
* dgud/ssl/dtls/GH-7955/OTP-19037:
  Add testcases.
  Monitor dtls listen caller
  Fix dtls listen on ipv6 with default ip
@dgud dgud closed this as completed in 8025f89 Mar 26, 2024
rickard-green pushed a commit that referenced this issue Apr 12, 2024
* dgud/ssl/dtls/GH-7955/OTP-19037:
  Add testcases.
  Monitor dtls listen caller
  Fix dtls listen on ipv6 with default ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:medium team:PS Assigned to OTP team PS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants