keys: Pass the network namespace into request_key mechanism
Create a request_key_net() function and use it to pass the network namespace domain tag into DNS revolver keys and rxrpc/AFS keys so that keys for different domains can coexist in the same keyring. Signed-off-by: David Howells <dhowells@redhat.com> cc: netdev@vger.kernel.org cc: linux-nfs@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-afs@lists.infradead.org
This commit is contained in:
@@ -22,7 +22,8 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
|
||||
char *ip_addr = NULL;
|
||||
int ip_len;
|
||||
|
||||
ip_len = dns_query(NULL, name, namelen, NULL, &ip_addr, NULL, false);
|
||||
ip_len = dns_query(net, NULL, name, namelen, NULL, &ip_addr, NULL,
|
||||
false);
|
||||
if (ip_len > 0)
|
||||
ret = rpc_pton(net, ip_addr, ip_len, sa, salen);
|
||||
else
|
||||
|
@@ -291,7 +291,7 @@ static struct key *nfs_idmap_request_key(const char *name, size_t namelen,
|
||||
if (IS_ERR(rkey)) {
|
||||
mutex_lock(&idmap->idmap_mutex);
|
||||
rkey = request_key_with_auxdata(&key_type_id_resolver_legacy,
|
||||
desc, "", 0, idmap);
|
||||
desc, NULL, "", 0, idmap);
|
||||
mutex_unlock(&idmap->idmap_mutex);
|
||||
}
|
||||
if (!IS_ERR(rkey))
|
||||
|
Reference in New Issue
Block a user