Question on adding some network-related features.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Question on adding some network-related features.

Ben Greear
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
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Question on adding some network-related features.

Jason Duell-3
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

_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Question on adding some network-related features.

Patrick McManus
In reply to this post by Ben Greear
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 <[hidden email]> 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
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Question on adding some network-related features.

Ben Greear
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 <[hidden email]> 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 <[hidden email]>
Candela Technologies Inc  http://www.candelatech.com

_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Question on adding some network-related features.

Patrick McManus
On Sat, Feb 23, 2013 at 10:32 PM, Ben Greear <[hidden email]> 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
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Question on adding some network-related features.

Ben Greear
On 02/24/2013 10:41 AM, Patrick McManus wrote:

> On Sat, Feb 23, 2013 at 10:32 PM, Ben Greear <[hidden email]> 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

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

Thanks,
Ben


>


--
Ben Greear <[hidden email]>
Candela Technologies Inc  http://www.candelatech.com

_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network