patch-2.4.21 linux-2.4.21/net/decnet/dn_nsp_in.c
Next file: linux-2.4.21/net/econet/af_econet.c
Previous file: linux-2.4.21/net/decnet/af_decnet.c
Back to the patch index
Back to the overall index
- Lines: 46
- Date:
2003-06-13 07:51:39.000000000 -0700
- Orig file:
linux-2.4.20/net/decnet/dn_nsp_in.c
- Orig date:
2001-11-09 14:12:54.000000000 -0800
diff -urN linux-2.4.20/net/decnet/dn_nsp_in.c linux-2.4.21/net/decnet/dn_nsp_in.c
@@ -565,26 +565,19 @@
*/
static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig, struct sk_buff_head *queue)
{
-#ifdef CONFIG_FILTER
- struct sk_filter *filter;
-#endif
+ int err;
/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
number of warnings when compiling with -W --ANK
*/
- if (atomic_read(&sk->rmem_alloc) + skb->truesize >= (unsigned)sk->rcvbuf
-)
- return -ENOMEM;
-
-#ifdef CONFIG_FILTER
- if (sk->filter) {
- int err = 0;
- if ((filter = sk->filter) != NULL && sk_filter(skb, sk->filter))
- err = -EPERM; /* Toss packet */
- if (err)
- return err;
+ if (atomic_read(&sk->rmem_alloc) + skb->truesize >= (unsigned)sk->rcvbuf) {
+ err = -ENOMEM;
+ goto out;
}
-#endif /* CONFIG_FILTER */
+
+ err = sk_filter(sk, skb, 0);
+ if (err)
+ goto out;
skb_set_owner_r(skb, sk);
skb_queue_tail(queue, skb);
@@ -602,8 +595,8 @@
(sig == SIGURG) ? POLL_PRI : POLL_IN);
}
read_unlock(&sk->callback_lock);
-
- return 0;
+out:
+ return err;
}
static void dn_nsp_otherdata(struct sock *sk, struct sk_buff *skb)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)