Re: [PATCH RESEND] ipv6: return with appropriate error code when sending RH0 using setsockopt()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Brian Haley
Date: Wednesday, September 3, 2008 - 11:36 am

Shan Wei wrote:

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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH RESEND] ipv6: return with appropriate error cod ..., Brian Haley, (Wed Sep 3, 11:36 am)