Don't pass IPv6 literals to the effective TLD service, since the brackets prevent them from being recognized as IPs

RESOLVED FIXED in Firefox 7

Status

()

Firefox
Location Bar
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dao, Assigned: dao)

Tracking

Trunk
Firefox 7
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 541454 [details] [diff] [review]
tests

I generated the attached tests based on <http://hg.mozilla.org/mozilla-central/rev/8b5646a07963>. The eTLD service fails for every host containing a dot, e.g. [::192.168.1.1], for which it considers "1.1]" to be the base domain.
(Assignee)

Comment 1

6 years ago
Or maybe the problem is that I'm passing the host with the brackets to getBaseDomainFromHost?
(Assignee)

Updated

6 years ago
Component: Networking → Location Bar
Product: Core → Firefox
QA Contact: networking → location.bar
Summary: Effective TLD service doesn't handle IPv6 literals containing dots correctly → Don't pass IPv6 literals to the effective TLD service, since the brackets prevent them from being recognized as IPs
(Assignee)

Comment 2

6 years ago
Created attachment 541604 [details] [diff] [review]
patch
Assignee: nobody → dao
Attachment #541454 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #541604 - Flags: review?(gavin.sharp)
There's PR_StringToNetAddr logic in nsEffectiveTLDService::GetBaseDomainInternal that I would assume should be catching this. Does it just not handle the bracket format? I'm not very familiar with ipv6 IP address formats.
(In reply to comment #3)
> There's PR_StringToNetAddr logic in
> nsEffectiveTLDService::GetBaseDomainInternal that I would assume should be
> catching this. Does it just not handle the bracket format? I'm not very
> familiar with ipv6 IP address formats.
IIRC it doesn't handle that format.
(Assignee)

Comment 5

6 years ago
Passing them without the brackets to getBaseDomainFromHost works, but removing the brackets in order to do that would be pointless, as getBaseDomainFromHost would just throw anyway.
getBaseDomainFromHost should probably also throw when the brackets are included, rather than returning a bogus result.
Comment on attachment 541604 [details] [diff] [review]
patch

can you file a followup for that and add a comment?
Attachment #541604 - Flags: review?(gavin.sharp) → review+
(Assignee)

Comment 8

6 years ago
http://hg.mozilla.org/mozilla-central/rev/a8b1330b8ac9

filed bug 667159
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 7
You need to log in before you can comment on or make changes to this bug.