mtu -= hlen + sizeof(struct frag_hdr);which could have been improved like this :
if (mtu < hlen + sizeof(struct frag_hdr) + 8) goto fail_toobig; mtu -= hlen + sizeof(struct frag_hdr);was instead re-written like this :
if (overflow_usub(mtu, hlen + sizeof(struct frag_hdr), &mtu) || mtu <= 7) goto fail_toobig;
Agreed.
“Tough but fair” used to be the ideal not the malady.
Magic numbers aside, I’m confused about how adding a “goto” to C++ code is an “improvement.”
Looking at the example given, I agree. Why be “nice” about it. Blunt saves time and effort.
I HATE people that write that kind of garbage to make themselves look smart and also to make themselves the only ones that can maintain the code.