Closed Bug 1233360 Opened 9 years ago Closed 8 years ago

proxy bypass ignored on Mac when using system proxy settings

Categories

(Core :: Networking, defect)

43 Branch
Unspecified
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: persiantools, Assigned: xeonchen)

References

Details

(Whiteboard: [necko-active])

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9

Steps to reproduce:

Firefox 43 on Mac OS X El-Capitan ignores system proxy bypass settings when it is using system proxy settings. I have set http and https proxies in Mac network preferences and the default proxy bypass string is *.local, 169.254/16, 192.168/16

This works flawlessly in Safari but Firefox fails to connect to local sites in 192.168.* network. On the other hand, Firefox fully honours proxy bypass patterns described in Automatic Network Configuration scripts.

This issue seems to be Mac specific and it is not reproducible on Windows. On an interesting note, I also found a similar issue 470207 which was resolved back in 2009.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:43.0) Gecko/20100101 Firefox/43.0
OS: Unspecified → Mac OS X
Component: Untriaged → Networking
Product: Firefox → Core
Whiteboard: [necko-backlog]
Assignee: nobody → xeonchen
Whiteboard: [necko-backlog] → [necko-active]
We didn't handle the form '<IP>/<prefix>', add implementation and tests here.
Comment on attachment 8749023 [details]
MozReview Request: Bug 1233360 - Part 1: Move out OSX bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50697/diff/1-2/
Attachment #8749023 - Attachment description: MozReview Request: Bug 1233360 - Part 1: Move out OSX bypass rules checker; r?badger → MozReview Request: Bug 1233360 - Part 1: Move out OSX bypass rules checker; r?bagder
Attachment #8749024 - Attachment description: MozReview Request: Bug 1233360 - Part 2: implement bypass rules checker; r?badger → MozReview Request: Bug 1233360 - Part 2: implement bypass rules checker; r?bagder
Attachment #8749025 - Attachment description: MozReview Request: Bug 1233360 - Part 3: add tests for OSX proxy bypass rules checker; r?badger → MozReview Request: Bug 1233360 - Part 3: add tests for OSX proxy bypass rules checker; r?bagder
Attachment #8749023 - Flags: review?(daniel)
Attachment #8749024 - Flags: review?(daniel)
Attachment #8749025 - Flags: review?(daniel)
Comment on attachment 8749024 [details]
MozReview Request: Bug 1233360 - Part 2: implement bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50699/diff/1-2/
Comment on attachment 8749025 [details]
MozReview Request: Bug 1233360 - Part 3: add tests for OSX proxy bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50701/diff/1-2/
Comment on attachment 8749023 [details]
MozReview Request: Bug 1233360 - Part 1: Move out OSX bypass rules checker; r?bagder

https://reviewboard.mozilla.org/r/50697/#review48017

::: toolkit/system/osxproxy/moz.build:12
(Diff revision 2)
>  SOURCES += [
>      'nsOSXSystemProxySettings.mm',
>  ]
>  
> +UNIFIED_SOURCES += [
> +    'ProxyUtils.cpp',

This makes it a lovely mix of .cpp and .mm files here. Did you make a decision here or how come the code extracted from a .mm got to be a .cpp?

I'm not aware of how we've decided what to use where, I'm just noticing the inconsistency here.
Attachment #8749023 - Flags: review?(daniel)
Attachment #8749024 - Flags: review?(daniel)
Comment on attachment 8749024 [details]
MozReview Request: Bug 1233360 - Part 2: implement bypass rules checker; r?bagder

https://reviewboard.mozilla.org/r/50699/#review48019

::: toolkit/system/osxproxy/ProxyUtils.cpp:16
(Diff revision 2)
>  namespace mozilla {
>  namespace toolkit {
>  namespace system {
>  
> -bool IsHostProxyEntry(const nsACString& aHost, const nsACString& aOverride)
> +static bool
> +IPv4Parser(const nsACString& aAddr, uint32_t& ipv4)

Why have your own implemenation that looks pretty much like a subset of inet_pton() ?
https://reviewboard.mozilla.org/r/50699/#review48019

> Why have your own implemenation that looks pretty much like a subset of inet_pton() ?

Yes, but we'll have to handle the form like '10/8' instead of '10.0.0.0/8'.
Also the result of inet_pton can't be masked directly, or is there a better solution?
https://reviewboard.mozilla.org/r/50697/#review48017

> This makes it a lovely mix of .cpp and .mm files here. Did you make a decision here or how come the code extracted from a .mm got to be a .cpp?
> 
> I'm not aware of how we've decided what to use where, I'm just noticing the inconsistency here.

I expect this function would be reused by other platforms.
But you're right, this should be done when it have to be.
Comment on attachment 8749023 [details]
MozReview Request: Bug 1233360 - Part 1: Move out OSX bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50697/diff/2-3/
Attachment #8749023 - Flags: review?(daniel)
Attachment #8749024 - Flags: review?(daniel)
Comment on attachment 8749024 [details]
MozReview Request: Bug 1233360 - Part 2: implement bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50699/diff/2-3/
Comment on attachment 8749025 [details]
MozReview Request: Bug 1233360 - Part 3: add tests for OSX proxy bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50701/diff/2-3/
https://reviewboard.mozilla.org/r/50699/#review48019

> Yes, but we'll have to handle the form like '10/8' instead of '10.0.0.0/8'.
> Also the result of inet_pton can't be masked directly, or is there a better solution?

Hi bagder, I've just made some modification, would you please see if it looks good to you?
Comment on attachment 8749024 [details]
MozReview Request: Bug 1233360 - Part 2: implement bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50699/diff/3-4/
Comment on attachment 8749025 [details]
MozReview Request: Bug 1233360 - Part 3: add tests for OSX proxy bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50701/diff/3-4/
Comment on attachment 8749023 [details]
MozReview Request: Bug 1233360 - Part 1: Move out OSX bypass rules checker; r?bagder

https://reviewboard.mozilla.org/r/50697/#review49041
Attachment #8749023 - Flags: review?(daniel) → review+
Attachment #8749024 - Flags: review?(daniel) → review+
Comment on attachment 8749024 [details]
MozReview Request: Bug 1233360 - Part 2: implement bypass rules checker; r?bagder

https://reviewboard.mozilla.org/r/50699/#review49043

Apart the little format nit, it looks fine!

::: toolkit/system/osxproxy/ProxyUtils.mm:58
(Diff revision 4)
> +
> +  if (aMaskLen > 96) {
> +    aAddr.pr_s6_addr32[3] = PR_htonl(
> +        PR_ntohl(aAddr.pr_s6_addr32[3]) & (~0L << (128 - aMaskLen)));
> +  }
> +  else if (aMaskLen > 64) {

Nit: our style guide says we write them '} else if' on the same line. You have this on several places.
Comment on attachment 8749025 [details]
MozReview Request: Bug 1233360 - Part 3: add tests for OSX proxy bypass rules checker; r?bagder

https://reviewboard.mozilla.org/r/50701/#review49045
Attachment #8749025 - Flags: review?(daniel) → review+
Comment on attachment 8749024 [details]
MozReview Request: Bug 1233360 - Part 2: implement bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50699/diff/4-5/
Comment on attachment 8749025 [details]
MozReview Request: Bug 1233360 - Part 3: add tests for OSX proxy bypass rules checker; r?bagder

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/50701/diff/4-5/
https://hg.mozilla.org/mozilla-central/rev/4ccbedc9308f
https://hg.mozilla.org/mozilla-central/rev/81add9b7d007
https://hg.mozilla.org/mozilla-central/rev/1b83aa3ab364
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
See Also: → 1275849
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: