diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-12-04 03:58:56 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-12-04 03:58:56 +0000 |
commit | 1d67e90f19a7acfd9a05dc59678e7d0c5090bd0d (patch) | |
tree | 357efc7b93f8f5102110d20d293f41360ec212fc /net | |
parent | aea27b2e18d69af87e673972246e66657b4fa274 (diff) |
Merge with Linux 2.3.21.
Diffstat (limited to 'net')
-rw-r--r-- | net/802/fc.c | 5 | ||||
-rw-r--r-- | net/core/netfilter.c | 3 | ||||
-rw-r--r-- | net/core/sock.c | 6 | ||||
-rw-r--r-- | net/decnet/dn_nsp_in.c | 3 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 11 | ||||
-rw-r--r-- | net/socket.c | 6 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 61 | ||||
-rw-r--r-- | net/unix/af_unix.c | 2 | ||||
-rw-r--r-- | net/x25/x25_in.c | 1 |
11 files changed, 66 insertions, 36 deletions
diff --git a/net/802/fc.c b/net/802/fc.c index 723e7dae5..67a27656d 100644 --- a/net/802/fc.c +++ b/net/802/fc.c @@ -88,7 +88,10 @@ int fc_rebuild_header(struct sk_buff *skb) printk("fc_rebuild_header: Don't know how to resolve type %04X addresses ?\n",(unsigned int)htons(fcllc->ethertype)); return 0; } - +#ifdef CONFIG_INET return arp_find(fch->daddr, skb); +#else + return 0; +#endif } diff --git a/net/core/netfilter.c b/net/core/netfilter.c index a6472a7de..91c46a9ef 100644 --- a/net/core/netfilter.c +++ b/net/core/netfilter.c @@ -310,9 +310,6 @@ static int nf_sockopt(struct sock *sk, int pf, int val, struct list_head *i; int ret; - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (down_interruptible(&nf_sockopt_mutex) != 0) return -EINTR; diff --git a/net/core/sock.c b/net/core/sock.c index 2b0018ec9..15b0ec64f 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1013,7 +1013,7 @@ void sock_def_error_report(struct sock *sk) read_lock(&sk->callback_lock); if (!sk->dead) { wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket,0); + sock_wake_async(sk->socket,0,POLL_ERR); } read_unlock(&sk->callback_lock); } @@ -1023,7 +1023,7 @@ void sock_def_readable(struct sock *sk, int len) read_lock(&sk->callback_lock); if(!sk->dead) { wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket,1); + sock_wake_async(sk->socket,1,POLL_IN); } read_unlock(&sk->callback_lock); } @@ -1041,7 +1041,7 @@ void sock_def_write_space(struct sock *sk) /* Should agree with poll, otherwise some programs break */ if (sock_writeable(sk)) - sock_wake_async(sk->socket, 2); + sock_wake_async(sk->socket, 2, POLL_OUT); } read_unlock(&sk->callback_lock); } diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index 23119cd9f..a997d253e 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c @@ -431,7 +431,8 @@ static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig struct socket *sock = sk->socket; wake_up_interruptible(sk->sleep); if (!(sock->flags & SO_WAITDATA) && sock->fasync_list) - kill_fasync(sock->fasync_list, sig); + kill_fasync(sock->fasync_list, sig, + (sig == SIGURG) ? POLL_PRI : POLL_IN); } read_unlock_irqrestore(&sk->callback_lock, flags); diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 37b41e93a..5ad993e60 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -117,6 +117,7 @@ static int __init ic_open_devs(void) last = &ic_first_dev; read_lock(&dev_base_lock); + rtnl_lock(); for (dev = dev_base; dev; dev = dev->next) { if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) : (!(dev->flags & IFF_LOOPBACK) && @@ -148,6 +149,7 @@ static int __init ic_open_devs(void) DBG(("IP-Config: Opened %s (able=%d)\n", dev->name, able)); } } + rtnl_unlock(); read_unlock(&dev_base_lock); *last = NULL; diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index b8e5d197c..4135d4c89 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -626,7 +626,7 @@ void tcp_write_space(struct sock *sk) wake_up_interruptible(sk->sleep); if (sock_wspace(sk) >= tcp_min_write_space(sk)) - sock_wake_async(sk->socket, 2); + sock_wake_async(sk->socket, 2, POLL_OUT); } read_unlock(&sk->callback_lock); } diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index f0711fccc..2f6bd37c9 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1403,7 +1403,7 @@ static void tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th) if (!sk->dead) { wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket, 1); + sock_wake_async(sk->socket, 1, POLL_HUP); } switch(sk->state) { @@ -1806,7 +1806,7 @@ static int tcp_data(struct sk_buff *skb, struct sock *sk, unsigned int len) */ if (!sk->dead) { wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket,1); + sock_wake_async(sk->socket,1, POLL_IN); } return(1); } @@ -1965,6 +1965,7 @@ static void tcp_check_urg(struct sock * sk, struct tcphdr * th) kill_proc(sk->proc, SIGURG, 1); else kill_pg(-sk->proc, SIGURG, 1); + sock_wake_async(sk->socket, 3, POLL_PRI); } /* We may be adding urgent data when the last byte read was @@ -2201,7 +2202,7 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, * this frame, the pred_flags won't match up. -DaveM */ wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket,1); + sock_wake_async(sk->socket,1, POLL_IN); tcp_delack_estimator(tp); tcp_remember_ack(tp, th, skb); @@ -2760,7 +2761,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, if(!sk->dead) { wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket, 0); + sock_wake_async(sk->socket, 0, POLL_IN); } return -1; } @@ -3017,7 +3018,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, */ if (!sk->dead && sk->sleep) { wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket, 1); + sock_wake_async(sk->socket,0,POLL_OUT); } tp->snd_una = TCP_SKB_CB(skb)->ack_seq; diff --git a/net/socket.c b/net/socket.c index 0064aaaa7..b85ea2a86 100644 --- a/net/socket.c +++ b/net/socket.c @@ -670,7 +670,7 @@ out: /* This function may be called only under socket lock or callback_lock */ -int sock_wake_async(struct socket *sock, int how) +int sock_wake_async(struct socket *sock, int how, int band) { if (!sock || !sock->fasync_list) return -1; @@ -689,9 +689,11 @@ int sock_wake_async(struct socket *sock, int how) call_kill: /* read_lock(&sock->sk->callback_lock); */ if(sock->fasync_list != NULL) - kill_fasync(sock->fasync_list, SIGIO); + kill_fasync(sock->fasync_list, SIGIO, band); /* read_unlock(&sock->sk->callback_lock); */ break; + case 3: + kill_fasync(sock->fasync_list, SIGURG, band); } return 0; } diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 87c0aedc1..610cfc07b 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -789,11 +789,29 @@ done: return result; } +static __inline__ void tcp_output_record(struct rpc_xprt *xprt) +{ + if(xprt->snd_sent && xprt->snd_task) + dprintk("RPC: write space\n"); + if(xprt->write_space == 0) + { + xprt->write_space = 1; + if (xprt->snd_task && !RPC_IS_RUNNING(xprt->snd_task)) + { + if(xprt->snd_sent) + dprintk("RPC: Write wakeup snd_sent =%d\n", + xprt->snd_sent); + rpc_wake_up_task(xprt->snd_task); + } + } +} + /* * TCP task queue stuff */ -static struct rpc_xprt *rpc_xprt_pending = NULL; /* Chain by rx_pending of rpc_xprt's */ +static struct rpc_xprt *rpc_rx_xprt_pending = NULL; /* Chain by rx_pending of rpc_xprt's */ +static struct rpc_xprt *rpc_tx_xprt_pending = NULL; /* Chain by tx_pending of rpc_xprt's */ /* * This is protected from tcp_data_ready and the stack as its run @@ -811,11 +829,11 @@ void rpciod_tcp_dispatcher(void) * Empty each pending socket */ - while((xprt=rpc_xprt_pending)!=NULL) + while((xprt=rpc_rx_xprt_pending)!=NULL) { int safe_retry=0; - rpc_xprt_pending=xprt->rx_pending; + rpc_rx_xprt_pending=xprt->rx_pending; xprt->rx_pending_flag=0; dprintk("rpciod_tcp_dispatcher: Processing %p\n", xprt); @@ -840,6 +858,13 @@ void rpciod_tcp_dispatcher(void) result); } } + + while((xprt=rpc_tx_xprt_pending)!=NULL) + { + rpc_tx_xprt_pending = xprt->tx_pending; + xprt->tx_pending_flag = 0; + tcp_output_record(xprt); + } } @@ -877,12 +902,12 @@ static void tcp_data_ready(struct sock *sk, int len) { int start_queue=0; - dprintk("RPC: xprt queue %p\n", rpc_xprt_pending); - if(rpc_xprt_pending==NULL) + dprintk("RPC: xprt queue %p\n", rpc_rx_xprt_pending); + if(rpc_rx_xprt_pending==NULL) start_queue=1; xprt->rx_pending_flag=1; - xprt->rx_pending=rpc_xprt_pending; - rpc_xprt_pending=xprt; + xprt->rx_pending=rpc_rx_xprt_pending; + rpc_rx_xprt_pending=xprt; if (start_queue) { tcp_rpciod_queue(); @@ -924,18 +949,16 @@ tcp_write_space(struct sock *sk) if (!(xprt = xprt_from_sock(sk))) return; - if(xprt->snd_sent && xprt->snd_task) - dprintk("RPC: write space\n"); - if(xprt->write_space == 0) - { - xprt->write_space = 1; - if (xprt->snd_task && !RPC_IS_RUNNING(xprt->snd_task)) - { - if(xprt->snd_sent) - dprintk("RPC: Write wakeup snd_sent =%d\n", - xprt->snd_sent); - rpc_wake_up_task(xprt->snd_task); - } + if (!xprt->tx_pending_flag) { + int start_queue = 0; + + if (rpc_tx_xprt_pending == NULL) + start_queue = 1; + xprt->tx_pending_flag = 1; + xprt->tx_pending = rpc_tx_xprt_pending; + rpc_tx_xprt_pending = xprt; + if (start_queue) + tcp_rpciod_queue(); } } diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index d4bec3a5d..55d8eff1f 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -299,7 +299,7 @@ static void unix_write_space(struct sock *sk) read_lock(&sk->callback_lock); if (!sk->dead && unix_writable(sk)) { wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket, 2); + sock_wake_async(sk->socket, 2, POLL_OUT); } read_unlock(&sk->callback_lock); } diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c index ad7adb7ea..f842aeece 100644 --- a/net/x25/x25_in.c +++ b/net/x25/x25_in.c @@ -278,6 +278,7 @@ static int x25_state3_machine(struct sock *sk, struct sk_buff *skb, int frametyp kill_proc(sk->proc, SIGURG, 1); else kill_pg(-sk->proc, SIGURG, 1); + sock_wake_async(sk, 3, POLL_PRI); } x25_write_internal(sk, X25_INTERRUPT_CONFIRMATION); break; |