Changes between Version 2 and Version 3 of MapGuideRfc118


Ignore:
Timestamp:
07/04/11 02:15:30 (13 years ago)
Author:
wuma
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc118

    v2 v3  
    4141 2. '''Port the IP address validation logic'''.
    4242There is existing logic to validate if the IP address specified in the configuration file is valid. But the logic always assumes the IP address is in v4 format. We need port the logic to consider both v4 format and v6 format. One example is like below in
    43 in {{{\Common\MapGuideCommon\Util\IpUtil.cpp}}}.
     43in '''{{{\Common\MapGuideCommon\Util\IpUtil.cpp}}}'''.
    4444{{{
    4545void MgIpUtil::ValidateAddress(CREFSTRING address, bool strict)
     
    6363}
    6464}}}
    65 It treats the character ''':''' as invalid. But for IPv6, ''':''' is used as a splitter for the address segments.
     65It treats the character '''{{{":"}}}''' as invalid. But for IPv6, '''{{{":"}}}''' is used as a splitter for the address segments.
    6666
     67 3. Make MapGuide Server listen to IPv6 address
     68When the service of MapGuide Server starts, it uses following code to listen to the client, site and admin ports:
     69'''''{{{Server\src\Core\Server.cpp}}}'''''
     70{{{
     71ACE_INET_Addr clientAddr((u_short)pServerManager->GetClientPort));
     72ACE_INET_Addr adminAddr((u_short)pServerManager->GetAdminPort());
     73ACE_INET_Addr siteAddr((u_short)pServerManager->GetSitePort());
     74}}}
     75But this way it always listens to IPv4 address no matter if IPv6 is available. Then the 3 '''{{{ACE_INET_Addr}}}''' instances need be created by another constructor:
     76{{{
     77ACE_INET_Addr (u_short port_number,
     78               const wchar_t host_name[],
     79               int address_family = AF_UNSPEC);
     80}}}
     81
     82by passing in an IPv6 address as '''{{{host_name}}}''', MapGuide Server can listen to the IPv6 address instead of IPv4 address.
     83But if the given '''{{{host_name}}}''' is a specific IP Address, the Client (Web Extension, Support Server, Admin etc.) has to connect to the Server through the given IP Address.
     84E.g. if there is a computer whose IP Addresses are:
     85
     86{{{
     87IPv4    127.0.0.1
     88        192.168.0.10
     89IPv6    ::1
     90        fe80::9c4b:2cb5:5cda:5c3f%11
     91}}}
     92
     93MapGuide Server should be able to be connected with either '''{{{127.0.0.1}}}''' or '''{{{192.168.0.10}}}''' for IPv4 and either '''{{{::1}}}''' or '''{{{fe80::9c4b:2cb5:5cda:5c3f%11}}}''' for IPv6. But if we pass '''{{{127.0.0.1}}}''' as the '''{{{host_name}}}''', MapGuide Server will NOT listen to '''{{{192.168.0.10}}}'''. The same for IPv6.
     94The solution is: we don’t pass in a specific IP Address, instead:
     95 * For IPv4, we pass in '''{{{0.0.0.0}}}'''. Then it will listen to all IPv4 addresses.
     96 * For IPv6, we pass in '''{{{::}}}'''. Then it will listen to all IPv6 address.
    6797
    6898== Implications ==