[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <470F6231.5020408@hitachi.com>
Date: Fri, 12 Oct 2007 21:01:53 +0900
From: Satoshi OSHIMA <satoshi.oshima.fk@...achi.com>
To: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Cc: Hideo AOKI <hideo.aoki.tk@...achi.com>,
Yumiko SUGITA <yumiko.sugita.yf@...achi.com>,
"??@...Hat" <haoki@...hat.com>,
Andi Kleen <andi@...stfloor.org>,
Evgeniy Polyakov <johnpol@....mipt.ru>,
Herbert Xu <herbert@...dor.apana.org.au>,
Stephen Hemminger <shemminger@...ux-foundation.org>,
?? ?? <yoshfuji@...ux-ipv6.org>
Subject: [PATCH 1/4] UDP memory accounting and limitation(take 5): fix send
buffer check
This patch introduces sndbuf size check before
memory allcation for send buffer.
signed-off-by: Satoshi Oshima <satoshi.oshima.fk@...achi.com>
signed-off-by: Hideo Aoki <haoki@...hat.com>
Index: 2.6.23-rc7-udp_limit/net/ipv4/ip_output.c
===================================================================
--- 2.6.23-rc7-udp_limit.orig/net/ipv4/ip_output.c
+++ 2.6.23-rc7-udp_limit/net/ipv4/ip_output.c
@@ -1004,6 +1004,11 @@ alloc_new_skb:
frag = &skb_shinfo(skb)->frags[i];
}
} else if (i < MAX_SKB_FRAGS) {
+ if (atomic_read(&sk->sk_wmem_alloc) + PAGE_SIZE
+ > 2 * sk->sk_sndbuf) {
+ err = -ENOBUFS;
+ goto error;
+ }
if (copy > PAGE_SIZE)
copy = PAGE_SIZE;
page = alloc_pages(sk->sk_allocation, 0);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists