]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
svcrpc: don't bother checking bad svc_addr_len result
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 21 Aug 2012 21:22:11 +0000 (17:22 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 21 Aug 2012 21:40:10 +0000 (17:40 -0400)
None of the callers should see an unsupported address family (only one
of them even bothers to check for that case), so just check for the
buggy case in svc_addr_len and don't bother elsewhere.

Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/linux/sunrpc/svc_xprt.h
net/sunrpc/svcsock.c

index 73c7a68667ea7c9f7e0e152f93d028db62da1b08..193dddab6511116b9ae8a4941395c32e0b5fb8db 100644 (file)
@@ -167,8 +167,7 @@ static inline size_t svc_addr_len(const struct sockaddr *sa)
        case AF_INET6:
                return sizeof(struct sockaddr_in6);
        }
-
-       return 0;
+       BUG();
 }
 
 static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt)
index 06ae8a7553495e05ee3c82d783ca2d7cd079debc..406688baac576d72fdd70e0e02692f641b660dde 100644 (file)
@@ -601,8 +601,6 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
                return -EAGAIN;
        }
        len = svc_addr_len(svc_addr(rqstp));
-       if (len == 0)
-               return -EAFNOSUPPORT;
        rqstp->rq_addrlen = len;
        if (skb->tstamp.tv64 == 0) {
                skb->tstamp = ktime_get_real();