Closed Bug 826455 Opened 7 years ago Closed 7 years ago

Want to be able to tell whether DNS returns an IPv4 mapped IPv6 address

Categories

(Core :: Networking: DNS, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: neil, Assigned: neil)

References

Details

(Whiteboard: [external-api-bustage])

Attachments

(1 file)

I want to link libmozldap as a shared rather than a static library but it wants to extract an IPv4 address from a mapped IPv6 address. Currently the functions to do this are only available within libxul.
Attached patch Proposed patchSplinter Review
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #697645 - Flags: review?(cbiesinger)
Comment on attachment 697645 [details] [diff] [review]
Proposed patch

+NS_IMETHODIMP nsNetAddr::GetIsV4Mapped(bool *aIsV4Mapped)
+{
+  switch(mAddr.raw.family) {
+  case AF_INET6:
+    *aIsV4Mapped = IPv6ADDR_IS_V4MAPPED(&mAddr.inet6.ip);

Why not use IsIPAddrV4Mapped? Are the different error codes worth the effort to not just do:

{
  *aIsV4Mapped = IsIPAddrV4Mapped(mAddr);
  return NS_OK;
}
Attachment #697645 - Flags: review?(joshmoz)
Comment on attachment 697645 [details] [diff] [review]
Proposed patch

OK, this is following the style of the other methods, so r=biesi

but please wait for josh's review, too
Attachment #697645 - Flags: review?(cbiesinger) → review+
Whiteboard: [external-api-bustage]
Even with the patch applied, for external api builds i still get

/opt/moz-objdir/mail/_virtualenv/bin/python /opt/comm-central/src/mozilla/config/pythonpath.py -I../../../mozilla/config /opt/comm-central/src/mozilla/config/expandlibs_exec.py --depend .deps/libmozldap.pp --target libmozldap.so --uselist --  c++  -pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Werror=conversion-null -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -Wno-long-long -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe  -DNDEBUG -DTRIMMED -g -fno-omit-frame-pointer  -fPIC -shared -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libmozldap.so -o libmozldap.so  nsLDAPProtocolModule.o nsLDAPMessage.o nsLDAPConnection.o nsLDAPOperation.o nsLDAPURL.o nsLDAPServer.o nsLDAPService.o nsLDAPBERValue.o nsLDAPControl.o nsLDAPBERElement.o nsLDAPModification.o nsLDAPSyncQuery.o nsLDAPSecurityGlue.o     -lpthread    -Wl,-rpath-link,/opt/moz-objdir/mail/mozilla/dist/bin:/usr/lib:/usr/local/lib:/lib -Wl,-rpath-link,/usr/local/lib    -L../../../mozilla/dist/bin -L../../../mozilla/dist/lib -lldap60 -lprldap60 -lldif60 /opt/moz-objdir/mail/mozilla/dist/lib/libxpcomglue_s.a -L/opt/moz-objdir/mail/mozilla/dist/bin -lxpcom -lmozalloc -L/opt/moz-objdir/mail/mozilla/dist/bin -ljs_static `/opt/moz-objdir/mail/mozilla/dist/sdk/bin/nspr-config --prefix=/opt/moz-objdir/mail/mozilla/dist --libdir=/opt/moz-objdir/mail/mozilla/dist/lib --libs`  -Wl,--version-script -Wl,/opt/comm-central/src/mozilla/build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl -lm    
nsLDAPConnection.o: In function `nsLDAPConnection::OnLookupComplete(nsICancelable*, nsIDNSRecord*, tag_nsresult)':
/opt/comm-central/src/ldap/xpcom/src/nsLDAPConnection.cpp:503: undefined reference to `mozilla::net::IsIPAddrV4Mapped(mozilla::net::NetAddr const*)'
/opt/comm-central/src/ldap/xpcom/src/nsLDAPConnection.cpp:515: undefined reference to `mozilla::net::NetAddrToString(mozilla::net::NetAddr const*, char*, unsigned int)'
/usr/bin/ld: libmozldap.so: hidden symbol `mozilla::net::NetAddrToString(mozilla::net::NetAddr const*, char*, unsigned int)' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[6]: *** [libmozldap.so] Error 1

I thought it was this bug, but maybe not...
No, there's a separate patch needed for c-c which I was going to attach in a separate bug once this gets review.
Attachment #697645 - Flags: review?(joshmoz) → review+
Blocks: 829208
https://hg.mozilla.org/mozilla-central/rev/33e9b69e55cc
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.