diff options
author | art <art@FreeBSD.org> | 2011-08-28 18:09:17 +0000 |
---|---|---|
committer | art <art@FreeBSD.org> | 2011-08-28 18:09:17 +0000 |
commit | b9e9f075adf0d8fbcf14849f471c3467560ee125 (patch) | |
tree | 3c2b0762cc6d236e0e5563177975568c3951bbb8 /sys/rpc | |
parent | f93067d423d47174fe4e2ea18f8c995ab46972b4 (diff) | |
download | FreeBSD-src-b9e9f075adf0d8fbcf14849f471c3467560ee125.zip FreeBSD-src-b9e9f075adf0d8fbcf14849f471c3467560ee125.tar.gz |
Make sure RPC calls over UDP return RPC_INTR status is the process has
been interrupted in a restartable syscall. Otherwise we could end up
in an (almost) endless loop in clnt_reconnect_call().
PR: kern/160198
Reviewed by: rmacklem
Approved by: re (kib), avg (mentor)
MFC after: 1 week
Diffstat (limited to 'sys/rpc')
-rw-r--r-- | sys/rpc/clnt_dg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c index a412c08..8a69bf4 100644 --- a/sys/rpc/clnt_dg.c +++ b/sys/rpc/clnt_dg.c @@ -467,7 +467,10 @@ send_again: cu->cu_waitflag, "rpccwnd", 0); if (error) { errp->re_errno = error; - errp->re_status = stat = RPC_CANTSEND; + if (error == EINTR || error == ERESTART) + errp->re_status = stat = RPC_INTR; + else + errp->re_status = stat = RPC_CANTSEND; goto out; } } @@ -636,7 +639,7 @@ get_reply: */ if (error != EWOULDBLOCK) { errp->re_errno = error; - if (error == EINTR) + if (error == EINTR || error == ERESTART) errp->re_status = stat = RPC_INTR; else errp->re_status = stat = RPC_CANTRECV; |