Re: [2.1.99] some fixes

Peter T. Breuer (ptb@it.uc3m.es)
Sun, 3 May 1998 19:33:28 +0200 (MET DST)


"A month of sundays ago David S. Miller wrote:"
>
> --- linux/net/ipv4/ip_fragment.c.org Sun May 3 16:34:41 1998
> +++ linux/net/ipv4/ip_fragment.c Sun May 3 16:34:48 1998
> @@ -350,7 +350,7 @@
> fp = qp->fragments;
> count = qp->ihlen;
> while(fp) {
> - if (fp->len < 0 || count+fp->len > skb->len) {
> + if (fp->len < 0 || fp->offset+qp->ihlen+fp->len > skb->len) {
> NETDEBUG(printk(KERN_ERR "Invalid fragment list: "
> "Fragment over size.\n"));
> ip_free(qp);
>
> This fix is DEAD WRONG, the fix is already there in the code, look at

?? I thought this was the nestea.c fix, as sent out by Alan? If the
final fix wasn't this, I would like to see it posted somewhere. The
comment I saw indicated an off by one count, and that this was the fix.

I looked at the source, and only deduced that it was complex according to
any measure ! One should avoid writing multiple counter code in C. It's
McCabe complexity is always very high because every counter gets
incremented at a different point and introduces a new break out point and
loop .. all spaghetti'ed together. Ecch.

Peter ptb2it.uc3m.es

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu