From: Hideo AOKI <[EMAIL PROTECTED]>
Date: Thu, 15 Nov 2007 16:50:14 -0500

> +static inline int __ip_check_max_skb_pages(struct sock *sk, int size)
> +{
> +     switch(sk->sk_protocol) {
> +     case IPPROTO_UDP:
> +             if (atomic_read(sk->sk_prot->memory_allocated) + size
> +                 > sk->sk_prot->sysctl_mem[0])
> +                     return -ENOBUFS;
> +             /* Fall through */      
> +     default:
> +             break;
> +     }
> +     return 0;
> +}
> +

This check misses UDPLITE, and this whole patch set is a designed in a
way that makes errors like this easy.

These special case checks are all over the place.

We don't have tests all over the place to see if a socket is TCP or
DCCP or SCTP in order to implement memory accounting there, because we
did it for connection oriented protocols cleanly, seperating things
via callbacks etc.

I would like to see the datagram memory accounting work similarly.
-
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