Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question on adding some network-related features.

16 views
Skip to first unread message

Ben Greear

unread,
Feb 22, 2013, 12:40:42 PM2/22/13
to
Hello!

I am interested in extending firefox so that it can bind to a specific
local IP address (and network interface on Linux, using SO_BINDTODEVICE).

I am also interested in adding c-ares support so I have better control
over DNS requests.

Are these features something that might be accepted upstream?

If so, are command-line arguments an acceptable way to allow
such configuration?

Thanks,
Ben

Jason Duell

unread,
Feb 22, 2013, 5:28:02 PM2/22/13
to dev-tech...@lists.mozilla.org
On 02/22/2013 09:40 AM, Ben Greear wrote:
> Hello!
>
> I am interested in extending firefox so that it can bind to a specific
> local IP address (and network interface on Linux, using SO_BINDTODEVICE).

Can I ask what the use case is here? The more useful the case, the more
likely that we'd take the patches. (Also depends on patch complexity).

You can probably tweak Firefox to use the NSPR "PR_Bind()" function to
choose a client-side IP/port. I don't know offhand if
PR_SocketSetSocketOption supports SO_BINDTODEVICE--looks like that might
require a patch to NSPR (which is a different product than Firefox, with
different code owners), to add a field to PRSocketOptionData.


> I am also interested in adding c-ares support so I have better control
> over DNS requests.

You should follow

https://bugzilla.mozilla.org/show_bug.cgi?id=773648

We're integrating libunbound to Firefox. Probably not room for 2 DNS
libs in the browser, but you could make your case if you think a
different lib is better.


> Are these features something that might be accepted upstream?
>
> If so, are command-line arguments an acceptable way to allow
> such configuration?

Command line args might be a good way to go: you could also use
about:config prefs.

cheers,

Jason

Patrick McManus

unread,
Feb 23, 2013, 6:23:15 PM2/23/13
to Ben Greear, dev-tech-network
Hi Ben - I've appreciated your linux networking contributions over the
years - nice to see you on a firefox list!

On Fri, Feb 22, 2013 at 12:40 PM, Ben Greear <gre...@candelatech.com> wrote:
> Hello!
>
> I am interested in extending firefox so that it can bind to a specific
> local IP address (and network interface on Linux, using SO_BINDTODEVICE).

that's something I could get behind.

>
> I am also interested in adding c-ares support so I have better control
> over DNS requests.

as jason said, we're moving towards libunbound with some alacrity..
can you do what you need in that framework?

>
> Are these features something that might be accepted upstream?
>
> If so, are command-line arguments an acceptable way to allow
> such configuration?

that's probably not the best approach.. firefox is just one app that
uses gecko/necko so the functionality would not be reachable in other
apps or if the firefox-app team went away from arguments or whatever
in the future.. doing it through prefs is better.. probably a new
method in http://mxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsISocketTransportService.idl
which the pref user would call.

-Pat

Ben Greear

unread,
Feb 23, 2013, 10:32:25 PM2/23/13
to Patrick McManus, dev-tech-network
On 02/23/2013 03:23 PM, Patrick McManus wrote:
> Hi Ben - I've appreciated your linux networking contributions over the
> years - nice to see you on a firefox list!

Thanks! I'm probably just passing through...just need a way to
make firefox be able to auto-login to wifi portals for a test
system. Seems web portals have gotten just a little bit too clever
to easily do this with curl these days...


> On Fri, Feb 22, 2013 at 12:40 PM, Ben Greear <gre...@candelatech.com> wrote:
>> Hello!
>>
>> I am interested in extending firefox so that it can bind to a specific
>> local IP address (and network interface on Linux, using SO_BINDTODEVICE).
>
> that's something I could get behind.

I implemented it with environment variables so I didn't have
to figure out how to get the config arguments properly passed
down to the socket code.

It's a bit of a hack, but I am not sure I have the time or
interest in doing much more. Maybe someone with more knowledge
of mozilla infrastructure can improve on the patches...

>> I am also interested in adding c-ares support so I have better control
>> over DNS requests.
>
> as jason said, we're moving towards libunbound with some alacrity..
> can you do what you need in that framework?

It does not appear to offer all that I want. I'd want to bind
to local interface, not just IP address, and more importantly,
there does not seem to be a way to specify that a particular
DNS server be used by a particular process. I'm going to have hundreds
of wifi station interfaces, and will need to do portal-login on
each of them using whatever DNS that particular virtual station
is configured for....

>> Are these features something that might be accepted upstream?
>>
>> If so, are command-line arguments an acceptable way to allow
>> such configuration?
>
> that's probably not the best approach.. firefox is just one app that
> uses gecko/necko so the functionality would not be reachable in other
> apps or if the firefox-app team went away from arguments or whatever
> in the future.. doing it through prefs is better.. probably a new
> method in http://mxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsISocketTransportService.idl
> which the pref user would call.

Do you normally post patches to mailing lists for review, or do I need
to open a bugzilla bug and attach a patch there?

Either way, can you suggest a good reference for the 'hg' commands
needed to create patches, etc? Is there anything like stgit for hg?

Thanks,
Ben


--
Ben Greear <gre...@candelatech.com>
Candela Technologies Inc http://www.candelatech.com

Patrick McManus

unread,
Feb 24, 2013, 1:41:53 PM2/24/13
to Ben Greear, dev-tech-network
On Sat, Feb 23, 2013 at 10:32 PM, Ben Greear <gre...@candelatech.com> wrote:
> On 02/23/2013 03:23 PM, Patrick McManus wrote:
>>
>
> I implemented it with environment variables so I didn't have
> to figure out how to get the config arguments properly passed
> down to the socket code.
>

http://mxr.mozilla.org/mozilla-central/source/modules/libpref/public/nsIPrefBranch.idl


>> as jason said, we're moving towards libunbound with some alacrity..
>> can you do what you need in that framework?
>
>
> It does not appear to offer all that I want. I'd want to bind
> to local interface, not just IP address, and more importantly,
> there does not seem to be a way to specify that a particular
> DNS server be used by a particular process. I'm going to have hundreds

I encourage you to work with josh aas and wouter from
https://bugzilla.mozilla.org/show_bug.cgi?id=773648 to make sure you
can get what you need - they seem like reasonable requirements at
first blush.

>
> Do you normally post patches to mailing lists for review, or do I need
> to open a bugzilla bug and attach a patch there?
>
> Either way, can you suggest a good reference for the 'hg' commands
> needed to create patches, etc? Is there anything like stgit for hg?

bugzilla and the patches attached therein are how reviews and checkins
happen for firefox. Its not optimal.

https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F

Ben Greear

unread,
Feb 24, 2013, 1:57:50 PM2/24/13
to Patrick McManus, dev-tech-network
I opened bugs and added attachments just before getting this email :)

https://bugzilla.mozilla.org/show_bug.cgi?id=844640
https://bugzilla.mozilla.org/show_bug.cgi?id=844639
0 new messages