]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/sunrpc/sunrpc.h
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
[karo-tx-linux.git] / net / sunrpc / sunrpc.h
index 14c9f6d1c5ff22987e6dfdbf2ce9a95508ee4696..f2b7cb540e61997ce427e132f7d0f20cada5a46e 100644 (file)
@@ -43,6 +43,19 @@ static inline int rpc_reply_expected(struct rpc_task *task)
                (task->tk_msg.rpc_proc->p_decode != NULL);
 }
 
+static inline int sock_is_loopback(struct sock *sk)
+{
+       struct dst_entry *dst;
+       int loopback = 0;
+       rcu_read_lock();
+       dst = rcu_dereference(sk->sk_dst_cache);
+       if (dst && dst->dev &&
+           (dst->dev->features & NETIF_F_LOOPBACK))
+               loopback = 1;
+       rcu_read_unlock();
+       return loopback;
+}
+
 int svc_send_common(struct socket *sock, struct xdr_buf *xdr,
                    struct page *headpage, unsigned long headoffset,
                    struct page *tailpage, unsigned long tailoffset);