I'm not sure you need this since it doesn't actually change anything,
setting the error before the check just seems like the style in this
function. It will get set to -EINVAL below...
This seems correct as trying to set an unsupported routing header type
is invalid, or trying to set a Type 2 that itself is invalid is bad.
The Unix I checked does this.
There's actually another bug here and in the sendmsg() path in that you
can set the hdrlen and segments_left fields to be invalid (according to
RFC3775), as long as the math works out (segments * 2 == length).
Segments_left should always be 1 and hdrlen 2 for a Type2 routing
header. The packet should be dropped at the destination, but we
probably shouldn't send it. I can send a patch for that later.
-Brian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html