Discussion:
IPv4: __vax__
(too old to reply)
Maxime Villard
2018-04-21 10:05:40 UTC
Permalink
A bizarre ifndef I noticed some time ago in IPv4:

[sys/netinet/ip_output.c]
1580 #ifndef __vax__
1581 if (cnt % sizeof(int32_t))
1582 return EINVAL;
1583 #endif

I don't understand why vax shouldn't have this check. The code dates back to
rev1, 25 years ago. I think we can keep the check but remove the ifndef.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Anders Magnusson
2018-04-21 11:37:19 UTC
Permalink
Hm, no idea.  Maybe it was that mbufs could end up with zero len here
(looking at the original code)?

Should be OK to remove it now.
Post by Maxime Villard
[sys/netinet/ip_output.c]
1580 #ifndef    __vax__
1581     if (cnt % sizeof(int32_t))
1582         return EINVAL;
1583 #endif
I don't understand why vax shouldn't have this check. The code dates back to
rev1, 25 years ago. I think we can keep the check but remove the ifndef.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Maxime Villard
2018-04-21 13:31:31 UTC
Permalink
Hm, no idea. Maybe it was that mbufs could end up with zero len here
(looking at the original code)?
I believe the goal of the check was to ensure that ip_insertoptions would
get a correctly 4-byte-aligned mbuf size, because it does not insert
padding to ensure 4-byte alignment.

If it's not aligned, ip_hl gets truncated and we probably end up sending
garbage on the network.
Should be OK to remove it now.
Alright, I've removed it.

Thanks,
Maxime

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...