Closed
Bug 844639
Opened 13 years ago
Closed 10 years ago
network: Allow binding sockets to network device.
Categories
(Core :: Networking: DNS, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 651882
People
(Reporter: greearb, Unassigned)
Details
Attachments
(1 file)
|
4.21 KB,
patch
|
mayhemer
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130206152940
Steps to reproduce:
I wish to bind all socket connections to a particular local interface.
Patch is attached that will allow this, though you may have to be root
user to have the binding work. This only works on Linux.
| Reporter | ||
Comment 1•13 years ago
|
||
Attachment #717645 -
Flags: review+
Updated•13 years ago
|
Component: Untriaged → Networking: DNS
Product: Firefox → Core
Updated•13 years ago
|
Attachment #717645 -
Flags: review+ → review?(joshmoz)
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #717645 -
Flags: review?(joshmoz) → review?(honzab.moz)
Comment 2•13 years ago
|
||
Comment on attachment 717645 [details] [diff] [review]
Patch to resolve this issue.
Review of attachment 717645 [details] [diff] [review]:
-----------------------------------------------------------------
regen the patch with -U 8 -P (context 8 lines and functions) for landing.
haven't tested, win32 doesn't support this option, too lazy to check on linux.
r=honzab with the comments addressed.
::: netwerk/base/src/nsSocketTransport2.cpp
@@ +1162,5 @@
> mFDconnected = false;
> }
>
> + {
> + static char* devname = getenv("BIND_DEVNAME");
"MOZ_" prefix?
PR_GetEnv
::: nsprpub/pr/include/prio.h
@@ +211,4 @@
> PR_SockOpt_NoDelay, /* don't delay send to coalesce packets */
> PR_SockOpt_MaxSegment, /* maximum segment size */
> PR_SockOpt_Broadcast, /* enable broadcast */
> + PR_SockOpt_BINDTODEV, /* Bind hard to network device */
_BindToDev
@@ +246,4 @@
> PRMcastRequest add_member; /* add an IP group membership */
> PRMcastRequest drop_member; /* Drop an IP group membership */
> PRNetAddr mcast_if; /* multicast interface address */
> + char* devname;
bind_dev_name
char const* ?
::: nsprpub/pr/src/io/prmapopt.c
@@ +422,5 @@
> #define SO_BROADCAST _PR_NO_SUCH_SOCKOPT
> #endif
>
> +#ifndef SO_BINDTODEVICE /* Bind hard to a device */
> +#define SO_BINDTODEVICE _PR_NO_SUCH_SOCKOPT
spacing as the defines above
::: nsprpub/pr/src/pthreads/ptio.c
@@ +3006,5 @@
> }
> + case PR_SockOpt_BINDTODEV:
> + {
> + rv = setsockopt(fd->secret->md.osfd, level, name,
> + data->value.devname, strlen(data->value.devname));
max 80 chars (not sure you are in it or not from splinter look)
Attachment #717645 -
Flags: review?(honzab.moz) → review+
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•