Commit fb6f1510 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: check the callback netid in gen_callback.

since we only support tcp, don't save the netinfo.
Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a733375f
......@@ -420,17 +420,24 @@ gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se)
{
struct nfs4_callback *cb = &clp->cl_callback;
/* Currently, we only support tcp for the callback channel */
if ((se->se_callback_netid_len != 3) || memcmp((char *)se->se_callback_netid_val, "tcp", 3))
goto out_err;
if ( !(parse_ipv4(se->se_callback_addr_len, se->se_callback_addr_val,
&cb->cb_addr, &cb->cb_port))) {
printk(KERN_INFO "NFSD: BAD callback address. client will not receive delegations\n");
cb->cb_parsed = 0;
return;
}
cb->cb_netid.len = se->se_callback_netid_len;
cb->cb_netid.data = se->se_callback_netid_val;
&cb->cb_addr, &cb->cb_port)))
goto out_err;
cb->cb_prog = se->se_callback_prog;
cb->cb_ident = se->se_callback_ident;
cb->cb_parsed = 1;
return;
out_err:
printk(KERN_INFO "NFSD: this client (clientid %08x/%08x) "
"will not receive delegations\n",
clp->cl_clientid.cl_boot, clp->cl_clientid.cl_id);
cb->cb_parsed = 0;
return;
}
/*
......
......@@ -75,7 +75,6 @@ struct nfs4_callback {
unsigned short cb_port;
u32 cb_prog;
u32 cb_ident;
struct xdr_netobj cb_netid;
/* RPC client info */
u32 cb_set; /* successful CB_NULL call */
struct rpc_program cb_program;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment