File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -772,40 +772,40 @@ bool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const
772
772
std::vector<unsigned char > CNetAddr::GetGroup () const
773
773
{
774
774
std::vector<unsigned char > vchRet;
775
- int nClass = 0 ; // 0=IPv6, 1=IPv4, 254=local, 255=unroutable
775
+ int nClass = NET_IPV6;
776
776
int nStartByte = 0 ;
777
777
int nBits = 16 ;
778
778
779
779
// all local addresses belong to the same group
780
780
if (IsLocal ())
781
781
{
782
- nClass = 254 ;
782
+ nClass = 255 ;
783
783
nBits = 0 ;
784
784
}
785
785
786
786
// all unroutable addresses belong to the same group
787
787
if (!IsRoutable ())
788
788
{
789
- nClass = 255 ;
789
+ nClass = NET_UNROUTABLE ;
790
790
nBits = 0 ;
791
791
}
792
792
// for IPv4 addresses, '1' + the 16 higher-order bits of the IP
793
793
// includes mapped IPv4, SIIT translated IPv4, and the well-known prefix
794
794
else if (IsIPv4 () || IsRFC6145 () || IsRFC6052 ())
795
795
{
796
- nClass = 1 ;
796
+ nClass = NET_IPV4 ;
797
797
nStartByte = 12 ;
798
798
}
799
799
// for 6to4 tunneled addresses, use the encapsulated IPv4 address
800
800
else if (IsRFC3964 ())
801
801
{
802
- nClass = 1 ;
802
+ nClass = NET_IPV4 ;
803
803
nStartByte = 2 ;
804
804
}
805
805
// for Teredo-tunneled IPv6 addresses, use the encapsulated IPv4 address
806
806
else if (IsRFC4380 ())
807
807
{
808
- vchRet.push_back (1 );
808
+ vchRet.push_back (NET_IPV4 );
809
809
vchRet.push_back (GetByte (3 ) ^ 0xFF );
810
810
vchRet.push_back (GetByte (2 ) ^ 0xFF );
811
811
return vchRet;
You can’t perform that action at this time.
0 commit comments