Opened 16 years ago
Closed 16 years ago
#3121 closed bug (fixed)
netinet/in.h defines INADDR_ANY wrong
Reported by: | noisetonepause | Owned by: | zooey |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Network & Internet/IPv4 | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
INADDR_ANY should be a compile time constant.
haiku's netinet/in.h defines it as IPADDR(0x00000000), where IPADDR is ((uint32_t)htonl((uint32_t)(x))).
ie., INADDR_ANY -> htonl(0x00000000), which is silly, and breaks some software (e.g. silc-client).
FreeBSD just defines it as a straight constant, 0x00000000.
Change History (4)
comment:1 by , 16 years ago
Component: | - General → Network & Internet/IPv4 |
---|---|
Owner: | changed from | to
follow-up: 3 comment:2 by , 16 years ago
comment:3 by , 16 years ago
Replying to axeld:
It's silly because this constant happen to be the same in both endians - other than that, can you please give an example of what it breaks exactly?
Sorry, I should've said that it breaks compilation - compiling silc-client fails because the code was expecting a constant.
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
While I would say that silc-client is broken in this regard then, it surely doesn't hurt to change that. I did so in hrev28625.
It's silly because this constant happen to be the same in both endians - other than that, can you please give an example of what it breaks exactly?