소스 검색

svcrpc: don't bother checking bad svc_addr_len result

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>
J. Bruce Fields 13 년 전
부모
커밋
af6d572134
2개의 변경된 파일1개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 2
      include/linux/sunrpc/svc_xprt.h
  2. 0 2
      net/sunrpc/svcsock.c

+ 1 - 2
include/linux/sunrpc/svc_xprt.h

@@ -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)

+ 0 - 2
net/sunrpc/svcsock.c

@@ -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();