Summary: | ASTERISK-29932: res_pjsip_sdp_rtp.c::create_rtp() binds to UDP6 for UDP4 peer on BSD | ||||
Reporter: | Justin T. Gibbs (scsiguy) | Labels: | |||
Date Opened: | 2022-02-22 15:48:02.000-0600 | Date Closed: | 2022-03-22 12:00:01 | ||
Priority: | Minor | Regression? | |||
Status: | Closed/Complete | Components: | Channels/chan_pjsip | ||
Versions: | 18.9.0 | Frequency of Occurrence | Constant | ||
Related Issues: |
| ||||
Environment: | FreeBSD 13.0-STABLE + Asterisk 18.10 + pjsip 2.11 IPv6 kernel support enabled, but no IPv6 configured interfaces | Attachments: | |||
Description: | First reported here (https://community.asterisk.org/t/pjsip-create-rtp-udp6-vs-udp4/83315). Pandemic intervened. Now I'm hoping to get to an acceptable solution that can be upstreamed into Asterisk.
On most BSD derived systems (iOS/MacOS, Free/Net/OpenBSD, etc.), IPv4 traffic is not routed to IPv6 sockets even when bound to the IPv6 wildcard address. Information about this policy is documented here (https://www.freebsd.org/cgi/man.cgi?query=inet6&sektion=4). This differs from the behavior of the Linux kernel. PJSIP support currently assumes that a wildcard bind will work for both IPv4 and IPv6 peers. This is incompatible with BSD systems. There are two options for solving this: 1) Bind to the IPv4 wildcard address unless the media endpoint has an ipv6 address. 2) Bind and poll sockets for the wildcard address for both IPv4 and IPv6. The attached patch does 1 and works for me. From the discussion in the community forum, there was some concern that doing so would break ICE. It's not clear to me that this is the case. It seems strange that an end-point exporting an IPv4 address would be proxied via IPv6. However, if this is allowed, I'm happy to implement option 2. If the decision is to go with option 2, I'm looking for some guidance on the best/idiomatic way to do this in Asterisk. I don't believe there are any other cases where a single virtual channel binds multiple sockets. Adding this into the existing pjsip code looks like it will require a pretty extensive change. This is why I'd like to understand the preferred approach before I dig into implementing this. | ||||
Comments: | By: Asterisk Team (asteriskteam) 2022-02-22 15:48:02.830-0600 Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed. A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report. Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur. Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/]. By: Joshua C. Colp (jcolp) 2022-02-22 16:15:53.773-0600 I have removed the comment with a patch. Inline patches are not accepted. Patches need to be attached and under license agreement. The best place for discussions, as well, is the asterisk-dev mailing list[1]. [1] http://lists.digium.com/mailman/listinfo/asterisk-dev By: Joshua C. Colp (jcolp) 2022-02-22 16:17:13.978-0600 I'll provide my comment here. It is perfectly fine, and expected, for ICE to provide both IPv4 and IPv6 addresses. Having multiple sockets to support this, however, would require modifications in multiple places to actually support. Option 1 would be acceptable under a different configuration option. By: Joshua C. Colp (jcolp) 2022-02-22 16:20:01.065-0600 In regards to the rtp_ipv6 option, I believe that actually predates the support for having both IPv4 and IPv6 in ICE at the same time and instead where you had to choose one or the other, and also when the SDP did not automatically choose based on the signaling. By: Asterisk Team (asteriskteam) 2022-03-22 12:00:00.996-0500 Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines |