rcnetdb.cpp uses == to compare two PRIPv6Addr structures

RESOLVED FIXED in 4.1

Status

NSPR
NSPR
P3
normal
RESOLVED FIXED
18 years ago
17 years ago

People

(Reporter: Wan-Teh Chang, Assigned: Wan-Teh Chang)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

18 years ago
This bug is reported by Braden N. McDaniel <braden@endoframe.com>.

Compilation of rcnetdb.cpp, revision 1.3, with USE_CPLUS=1 USE_IPV6=1 fails:
coffee:/u/wtc/tip/mozilla/nsprpub/pr/src/cplus 65% gmake USE_CPLUS=1 USE_IPV6=1
g++ -o Linux2.2.5_x86_PTH_DBG.OBJ/rcnetdb.o -c  -g -fPIC -ansi -Wall -pipe
-DLINUX -Dlinux -Di386 -D_POSIX_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE
-DHAVE_STRERROR -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
-D_PR_INET6 -DXP_UNIX -DDEBUG -UNDEBUG -DDEBUG_wtc -D_REENTRANT -D_NSPR_BUILD_
-I../../../../dist/Linux2.2.5_x86_PTH_DBG.OBJ/include  rcnetdb.cpp
rcnetdb.cpp: In method `PRBool RCNetAddr::EqualHost(const class RCNetAddr &)
const':
rcnetdb.cpp:96: no match for `const PRIPv6Addr & == const PRIPv6Addr &'
rcnetdb.cpp: In method `const class RCNetAddr * RCHostLookup::operator
[](PRUintn)':
rcnetdb.cpp:211: warning: comparison between signed and unsigned
gmake: *** [Linux2.2.5_x86_PTH_DBG.OBJ/rcnetdb.o] Error 1

The problem is that RCNetAddr::EqualHost uses the == operator to
compare two PRIPv6Addr structures.  We need to use memcmp to compare
two structures.

Also, now that PR_AF_INET6 is always defined, we can get rid of
the #ifdef _PR_INET6 in this file.
(Assignee)

Comment 1

18 years ago
Created attachment 7446 [details] [diff] [review]
Proposed fix.
(Assignee)

Comment 2

18 years ago
The fix is checked in.
/cvsroot/mozilla/nsprpub/pr/src/cplus/rcnetdb.cpp, revision 1.4
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.1
You need to log in before you can comment on or make changes to this bug.