aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/afs/vlclient.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-11-02 15:27:47 +0000
committerDavid Howells <dhowells@redhat.com>2017-11-13 15:38:17 +0000
commit4d9df9868f31df6725481135c10ac6419ce58d44 (patch)
treec4fcbe437438c940485d438ad5c5871ab20d3288 /fs/afs/vlclient.c
parentafs: Update the cache index structure (diff)
downloadwireguard-linux-4d9df9868f31df6725481135c10ac6419ce58d44.tar.xz
wireguard-linux-4d9df9868f31df6725481135c10ac6419ce58d44.zip
afs: Keep and pass sockaddr_rxrpc addresses rather than in_addr
Keep and pass sockaddr_rxrpc addresses around rather than keeping and passing in_addr addresses to allow for the use of IPv6 and non-standard port numbers in future. This also allows the port and service_id fields to be removed from the afs_call struct. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/vlclient.c')
-rw-r--r--fs/afs/vlclient.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c
index f5a043a9ba61..48d137628d6a 100644
--- a/fs/afs/vlclient.c
+++ b/fs/afs/vlclient.c
@@ -12,6 +12,7 @@
#include <linux/gfp.h>
#include <linux/init.h>
#include <linux/sched.h>
+#include "afs_fs.h"
#include "internal.h"
/*
@@ -83,8 +84,15 @@ static int afs_deliver_vl_get_entry_by_xxx(struct afs_call *call)
bp++; /* type */
entry->nservers = ntohl(*bp++);
- for (loop = 0; loop < 8; loop++)
- entry->servers[loop].s_addr = *bp++;
+ for (loop = 0; loop < 8; loop++) {
+ entry->servers[loop].srx_family = AF_RXRPC;
+ entry->servers[loop].srx_service = FS_SERVICE;
+ entry->servers[loop].transport_type = SOCK_DGRAM;
+ entry->servers[loop].transport_len = sizeof(entry->servers[loop].transport.sin);
+ entry->servers[loop].transport.sin.sin_family = AF_INET;
+ entry->servers[loop].transport.sin.sin_port = htons(AFS_FS_PORT);
+ entry->servers[loop].transport.sin.sin_addr.s_addr = *bp++;
+ }
bp += 8; /* partition IDs */
@@ -144,7 +152,7 @@ static const struct afs_call_type afs_RXVLGetEntryById = {
* dispatch a get volume entry by name operation
*/
int afs_vl_get_entry_by_name(struct afs_net *net,
- struct in_addr *addr,
+ struct sockaddr_rxrpc *addr,
struct key *key,
const char *volname,
struct afs_cache_vlocation *entry,
@@ -166,8 +174,6 @@ int afs_vl_get_entry_by_name(struct afs_net *net,
call->key = key;
call->reply = entry;
- call->service_id = VL_SERVICE;
- call->port = htons(AFS_VL_PORT);
/* marshall the parameters */
bp = call->request;
@@ -185,7 +191,7 @@ int afs_vl_get_entry_by_name(struct afs_net *net,
* dispatch a get volume entry by ID operation
*/
int afs_vl_get_entry_by_id(struct afs_net *net,
- struct in_addr *addr,
+ struct sockaddr_rxrpc *addr,
struct key *key,
afs_volid_t volid,
afs_voltype_t voltype,
@@ -203,8 +209,6 @@ int afs_vl_get_entry_by_id(struct afs_net *net,
call->key = key;
call->reply = entry;
- call->service_id = VL_SERVICE;
- call->port = htons(AFS_VL_PORT);
/* marshall the parameters */
bp = call->request;