tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Support for 240/4 and 0/8 addresses in NetBSD





On 10/06/23 13:58, Seth David Schoen wrote:
 I noticed that NetBSD still has the
traditional behavior in sys/netinet/in.c,

I've noticed the following code in sys/netinet/igmp.c,

	if (... && (ip->ip_src.s_addr & IN_CLASSA_NET) == 0)...

Surely that will not interoperate with the use of 0/8?

Also, you can compare against htonl(INADDR_BROADCAST) and htonl(INADDR_ANY) without any runtime penalty because the C compiler will evaluate those expressions at compile time (I checked). You don't need to optimise them yourself. I'm one of those people who likes code to say the right thing, and not just compute the right thing. You know, just in case the IP broadcast address gets changed. Again.

Cheers,
Lloyd


Home | Main Index | Thread Index | Old Index