In bip.c getter and setter functions of IP address and Port number expect and return values in the network byte order. All ntoh and hton were eliminated from bip.c.

All other modules changed to be consistent.
arm7 port left unchanged.
This commit is contained in:
bacpack
2010-11-04 13:30:26 +00:00
parent 437112cc52
commit a639864cc8
9 changed files with 46 additions and 46 deletions
+3 -3
View File
@@ -167,7 +167,7 @@ void dlenv_init(
#endif
pEnv = getenv("BACNET_IP_PORT");
if (pEnv) {
bip_set_port((uint16_t) strtol(pEnv, NULL, 0));
bip_set_port(htons((uint16_t) strtol(pEnv, NULL, 0)));
} else {
/* BIP_Port is statically initialized to 0xBAC0,
* so if it is different, then it was programmatically altered,
@@ -175,8 +175,8 @@ void dlenv_init(
* Unless it is set below 1024, since:
* "The range for well-known ports managed by the IANA is 0-1023."
*/
if (bip_get_port() < 1024)
bip_set_port(0xBAC0);
if (ntohs(bip_get_port()) < 1024)
bip_set_port(htons(0xBAC0));
}
#elif defined(BACDL_MSTP)
pEnv = getenv("BACNET_MAX_INFO_FRAMES");