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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user