Skip to content

Commit af6d572

Browse files
author
J. Bruce Fields
committed
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>
1 parent f23abfd commit af6d572

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

‎include/linux/sunrpc/svc_xprt.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ static inline size_t svc_addr_len(const struct sockaddr *sa)
167167
case AF_INET6:
168168
return sizeof(struct sockaddr_in6);
169169
}
170-
171-
return 0;
170+
BUG();
172171
}
173172

174173
static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt)

‎net/sunrpc/svcsock.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,6 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
601601
return -EAGAIN;
602602
}
603603
len = svc_addr_len(svc_addr(rqstp));
604-
if (len == 0)
605-
return -EAFNOSUPPORT;
606604
rqstp->rq_addrlen = len;
607605
if (skb->tstamp.tv64 == 0) {
608606
skb->tstamp = ktime_get_real();

0 commit comments

Comments
 (0)