On Sun, Jan 06, 2008 at 01:57:13AM +0100, Jan Engelhardt wrote:
>
> >@@ -304,7 +305,8 @@ static int raw_send_hdrinc(struct sock *sk, void *from, 
> >size_t length,
> >             goto error_fault;
> > 
> >     /* We don't modify invalid header */
> >-    if (length >= sizeof(*iph) && iph->ihl * 4U <= length) {
> >+    iphlen = iph->ihl * 4;
> >+    if (iphlen >= sizeof(*iph) && iphlen <= length) {
> 
> Humm, this could use ip_hdrlen(skb) :-)

That would not necessarily be an improvement since we'd have to reload
the values from skb.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to