Opened 10 years ago

Closed 10 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:
Has a Patch: no 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 Changed 10 years ago by noisetonepause

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

comment:2 Changed 10 years ago by 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?

comment:3 in reply to:  2 Changed 10 years ago by noisetonepause

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 Changed 10 years ago by axeld

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.