patch-2.4.23 linux-2.4.23/net/netlink/af_netlink.c

Next file: linux-2.4.23/net/netsyms.c
Previous file: linux-2.4.23/net/irda/wrapper.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/net/netlink/af_netlink.c linux-2.4.23/net/netlink/af_netlink.c
@@ -846,8 +846,17 @@
 		size = NLMSG_SPACE(4 + NLMSG_ALIGN(nlh->nlmsg_len));
 
 	skb = alloc_skb(size, GFP_KERNEL);
-	if (!skb)
-		return;
+	if (!skb) {
+		struct sock *sk;
+
+		sk = netlink_lookup(in_skb->sk->protocol,
+				    NETLINK_CB(in_skb).pid);
+		if (sk) {
+			sk->err = ENOBUFS;
+			sk->error_report(sk);
+			sock_put(sk);
+		}
+	}
 
 	rep = __nlmsg_put(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq,
 			  NLMSG_ERROR, sizeof(struct nlmsgerr));

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)