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 noisetonepause, 16 years ago

Component: - GeneralNetwork & Internet/IPv4
Owner: changed from axeld to zooey

comment:2 by axeld, 16 years ago

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?

in reply to:  2 comment:3 by noisetonepause, 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 axeld, 16 years ago

Resolution: fixed
Status: newclosed

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.

Note: See TracTickets for help on using tickets.