Maybe broken is too strong a word I agree
Maybe broken is too strong a word I agree
(I'm referring to the || mtu <= 7 part), which, once you know how usub_overflow works is obvious what it means, but this might not be evident and unnecessarily complicating that snipped
Sometimes 'smart code' is not necessarily better
(I'm open to disagreement, though)
What's more interesting to me is how low-stakes this issue is. Gizmodo wrote an article about it, but really, if you understand kernel C, do you even give a shit about this code? Linus could have said "we're not using GCC builtin overflow intrinics", just like that, one line no punctuation, and the issue would have been settled.
But look at this thread at the number of people who extrapolated from Linus' rant that this code was bad, ruinous, unsafe, "one size fits all" (still scratching my head about that), &c. How many of Linus' defenders actually know what he's ranting about? It looks to me like: not many.
What's funny is, you actually do seem like you know what he's talking about, and even you overshot the mark with "broken". :)
I would argue that it's usually not, especially in large and long lived projects. “Everyone knows that debugging is twice as hard as writing a program”.