Re: [PATCH] Improve behaviour of Netlink Sockets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 27 Aug 2004 12:52:25 +0200, Pablo Neira wrote:
[ added some additional context ]
>		if (!timeo) {
>			if (!nlk->pid)
>				netlink_overrun(sk);
>			sock_put(sk);
>			kfree_skb(skb);
>  			return -EAGAIN;
>  		}
>  
> +		if (nlk->pid) {
> +			/* Kernel is sending information to user space
> +			 * and socket buffer is full: Wake up user
> +			 * process */
> +			client = find_task_by_pid(nlk->pid);
> +			if (!client) {
> +				sock_put(sk);
> +				kfree_skb(skb);
> +				return -EAGAIN;
> +			}
> +			wake_up_process(client);
> +		}
> +
>  		__set_current_state(TASK_INTERRUPTIBLE);
>  		add_wait_queue(&nlk->wait, &wait);

What test case did you use for this patch? AFAICS any netlink_unicast
caller passing MSG_DONTWAIT (i.e. all of them) will still have the skb
freed and return with -EAGAIN.  However, the caller itself cannot block
no matter if MSG_DONTWAIT is passed or not. This  suggests an inspection
of existing callers, to check whether they are still optimal with the
new semantics. No?

Roger
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux