All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] peer_pid checking in ip_queue
@ 2004-03-23 11:09 Pablo Neira
  2004-03-23 17:25 ` Patrick McHardy
  2004-03-27 21:17 ` Harald Welte
  0 siblings, 2 replies; 11+ messages in thread
From: Pablo Neira @ 2004-03-23 11:09 UTC (permalink / raw)
  To: netfilter-devel, Harald Welte

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

Hi,

I patched ip_queue.c to modify the default behaviour if peer_pid is 0. 
In this case, there's no program in user space to receive the skbuff via 
netlink, but ip_queue will allocate space for the skbuff and after 
checking if peer_pid is 0, it will destroy this skbuff allocated. Am I 
missing anything?

best regards,
Pablo

P.S: BTW, Harald, I noticed that I had some problems with my smtp server 
and some email got lost, I sent you an email with a "digest" of all my 
recent patches, did you receive it? If not, please let me know.

[-- Attachment #2: ip_queue-peer_pid.patch --]
[-- Type: text/plain, Size: 769 bytes --]

--- linux-2.6.3-old/net/ipv4/netfilter/ip_queue.c	2004-02-18 04:59:59.000000000 +0100
+++ linux-2.6.3/net/ipv4/netfilter/ip_queue.c	2004-03-23 10:31:16.000000000 +0100
@@ -277,6 +277,9 @@
 	struct sk_buff *nskb;
 	struct ipq_queue_entry *entry;
 
+	if (!peer_pid)
+		return -EINVAL;
+
 	if (copy_mode == IPQ_COPY_NONE)
 		return -EAGAIN;
 
@@ -303,9 +306,6 @@
 		
 	write_lock_bh(&queue_lock);
 	
-	if (!peer_pid)
-		goto err_out_free_nskb; 
-
  	/* netlink_unicast will either free the nskb or attach it to a socket */ 
 	status = netlink_unicast(ipqnl, nskb, peer_pid, MSG_DONTWAIT);
 	if (status < 0)
@@ -318,9 +318,6 @@
 	write_unlock_bh(&queue_lock);
 	return status;
 
-err_out_free_nskb:
-	kfree_skb(nskb); 
-	
 err_out_unlock:
 	write_unlock_bh(&queue_lock);
 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-03-27 23:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-23 11:09 [PATCH] peer_pid checking in ip_queue Pablo Neira
2004-03-23 17:25 ` Patrick McHardy
2004-03-23 18:10   ` Pablo Neira
2004-03-23 22:44     ` Patrick McHardy
2004-03-24  0:07       ` Henrik Nordstrom
2004-03-24  0:42         ` Pablo Neira
2004-03-24  2:11           ` Patrick McHardy
2004-03-24  0:47         ` Patrick McHardy
2004-03-27 21:20       ` Harald Welte
2004-03-27 23:50         ` Patrick McHardy
2004-03-27 21:17 ` Harald Welte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.