summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2004-01-17 21:25:05 +0000
committeralfred <alfred@FreeBSD.org>2004-01-17 21:25:05 +0000
commitffaedccd58d520477e2c30fd54a710cc663c1f6a (patch)
treea4a99a664b9e16d01c993b9abc06fb990a178631 /sys/rpc
parent13a64c8523fa176dd82213b32a0a0d8d1d3b4639 (diff)
downloadFreeBSD-src-ffaedccd58d520477e2c30fd54a710cc663c1f6a.zip
FreeBSD-src-ffaedccd58d520477e2c30fd54a710cc663c1f6a.tar.gz
Don't panic because of RPC proto mismatches. Whitespace cleanup.
Submitted by: Jim Rees <rees@umich.edu>
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/rpcclnt.c72
1 files changed, 37 insertions, 35 deletions
diff --git a/sys/rpc/rpcclnt.c b/sys/rpc/rpcclnt.c
index d733080..01de50a 100644
--- a/sys/rpc/rpcclnt.c
+++ b/sys/rpc/rpcclnt.c
@@ -1039,7 +1039,7 @@ rpcclnt_reply(myrep, td)
if (*tl != rpc_reply) {
rpcstats.rpcinvalid++;
m_freem(mrep);
- rpcmout:
+rpcmout:
if (myrep->r_flags & R_GETONEREP)
RPC_RETURN(0);
continue;
@@ -1308,48 +1308,50 @@ rpcclnt_request(rpc, mrest, procnum, td, cred, reply)
goto rpcmout;
} else if (reply->stat.type != RPC_MSGACCEPTED) {
error = EBADRPC;
- goto rpcmout;
- }
+ goto rpcmout;
+ }
- rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
+ rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
- reply->verf_md = md;
- reply->verf_dpos = dpos;
+ reply->verf_md = md;
+ reply->verf_dpos = dpos;
- reply->verf_type = fxdr_unsigned(u_int32_t, *tl++);
- reply->verf_size = fxdr_unsigned(u_int32_t, *tl);
+ reply->verf_type = fxdr_unsigned(u_int32_t, *tl++);
+ reply->verf_size = fxdr_unsigned(u_int32_t, *tl);
- if (reply->verf_size != 0)
- rpcm_adv(rpcm_rndup(reply->verf_size));
+ if (reply->verf_size != 0)
+ rpcm_adv(rpcm_rndup(reply->verf_size));
- rpcm_dissect(tl, u_int32_t *, RPCX_UNSIGNED);
- reply->stat.status = fxdr_unsigned(u_int32_t, *tl);
-
- if (reply->stat.status == RPC_SUCCESS) {
- if ((uint32_t)(dpos - mtod(md, caddr_t)) >= md->m_len) {
- RPCDEBUG("where is the next mbuf?");
- RPCDEBUG("%d -> %d", (int)(dpos - mtod(md, caddr_t)), md->m_len);
- if (md->m_next == NULL) {
- error = EBADRPC;
- goto rpcmout;
- } else {
- reply->result_md = md->m_next;
- reply->result_dpos = mtod(reply->result_md, caddr_t);
- }
+ rpcm_dissect(tl, u_int32_t *, RPCX_UNSIGNED);
+ reply->stat.status = fxdr_unsigned(u_int32_t, *tl);
+
+ if (reply->stat.status == RPC_SUCCESS) {
+ if ((uint32_t)(dpos - mtod(md, caddr_t)) >= md->m_len) {
+ RPCDEBUG("where is the next mbuf?");
+ RPCDEBUG("%d -> %d",
+ (int)(dpos - mtod(md, caddr_t)), md->m_len);
+ if (md->m_next == NULL) {
+ error = EBADRPC;
+ goto rpcmout;
} else {
- reply->result_md = md;
- reply->result_dpos = dpos;
+ reply->result_md = md->m_next;
+ reply->result_dpos = mtod(reply->result_md,
+ caddr_t);
}
- } else if (reply->stat.status == RPC_PROGMISMATCH) {
- rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
- reply->stat.mismatch_info.low = fxdr_unsigned(u_int32_t, *tl++);
- reply->stat.mismatch_info.high = fxdr_unsigned(u_int32_t, *tl);
- error = EOPNOTSUPP;
- goto rpcmout;
- } else if (reply->stat.status > 5) {
- error = EBADRPC;
- goto rpcmout;
+ } else {
+ reply->result_md = md;
+ reply->result_dpos = dpos;
}
+ } else if (reply->stat.status == RPC_PROGMISMATCH) {
+ rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
+ reply->stat.mismatch_info.low = fxdr_unsigned(u_int32_t, *tl++);
+ reply->stat.mismatch_info.high = fxdr_unsigned(u_int32_t, *tl);
+ error = EOPNOTSUPP;
+ goto rpcmout;
+ } else {
+ error = EPROTONOSUPPORT;
+ goto rpcmout;
+ }
error = 0;
rpcmout:
OpenPOWER on IntegriCloud