New issue
Advanced search Search tips

Issue 880934 link

Starred by 2 users

Issue metadata

Status: Unconfirmed
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

SO_REUSEPORT is not supported in the chrome.udp.sockets API

Reported by p...@pvh.ca, Sep 5

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Steps to reproduce the problem:
Currently, it is not possible to write an application that participates in mDNS or behaves like mDNS as Chrome will only bind exclusively to UDP sockets.

This manifests as an error when trying to bind a UDP socket to port 5353, since on most computers there will already be an mDNS client running which prevents Chrome from taking an exclusive lock on the port.

Similarly, binding to 5353 will prevent other spec-conforming applications from running since they won't be able to listen on the port.

What is the expected behavior?
Chrome's UDP sockets API should have the ability to allowPortReuse() after creation and before binding, setting SO_REUSEPORT on POSIX systems and SO_REUSEADDR on Windows.

What went wrong?
.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 68.0.3440.106  Channel: n/a
OS Version: 10.0
Flash Version:
 
A substantially bit-rotted candidate patch from five years ago is linked here: https://codereview.chromium.org/15039012/#ps31001

There has been some discussion of these issues in the distant past, including these three discussions: https://bugs.chromium.org/p/chromium/issues/detail?id=238819
https://bugs.chromium.org/p/chromium/issues/detail?id=489511
https://bugs.chromium.org/p/chromium/issues/detail?id=497875

It's not clear to me why the author of the allowReuseAddress version of the patch was comfortable with SO_REUSEADDR but not SO_REUSEPORT, as on POSIX systems SO_REUSEADDR only allows for faster rebinding of UDP ports after their original owner is disposed of.

I have a candidate patch in progress based on the original patch that should support Windows, Mac, and Linux/chromeOS and cargo-cult updated to what appears to be present style which I hope to attach if it ever finishes compiling on my local machine.
Cc: slightlyoff@chromium.org
Labels: Needs-Triage-M68
Cc: yhirano@chromium.org
Components: -Blink>Network Platform>Apps>API

Sign in to add a comment