diff options
author | David Howells <dhowells@redhat.com> | 2017-11-02 15:27:47 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-11-13 15:38:17 +0000 |
commit | 3838d3ecdea496699a8c13c183d4df5dfe8e1a3e (patch) | |
tree | 66a9268464a94f63f65073493be06a5f4aff70a8 /fs/afs/vlclient.c | |
parent | 4d9df9868f31df6725481135c10ac6419ce58d44 (diff) | |
download | linux-stable-3838d3ecdea496699a8c13c183d4df5dfe8e1a3e.tar.gz linux-stable-3838d3ecdea496699a8c13c183d4df5dfe8e1a3e.tar.bz2 linux-stable-3838d3ecdea496699a8c13c183d4df5dfe8e1a3e.zip |
afs: Allow IPv6 address specification of VL servers
Allow VL server specifications to be given IPv6 addresses as well as IPv4
addresses, for example as:
echo add foo.org 1111:2222:3333:0:4444:5555:6666:7777 >/proc/fs/afs/cells
Note that ':' is the expected separator for separating IPv4 addresses, but
if a ',' is detected or no '.' is detected in the string, the delimiter is
switched to ','.
This also works with DNS AFSDB or SRV record strings fetched by upcall from
userspace.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/vlclient.c')
-rw-r--r-- | fs/afs/vlclient.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c index 48d137628d6a..276319aa86d8 100644 --- a/fs/afs/vlclient.c +++ b/fs/afs/vlclient.c @@ -88,10 +88,15 @@ static int afs_deliver_vl_get_entry_by_xxx(struct afs_call *call) 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++; + entry->servers[loop].transport_len = sizeof(entry->servers[loop].transport.sin6); + entry->servers[loop].transport.sin6.sin6_family = AF_INET6; + entry->servers[loop].transport.sin6.sin6_port = htons(AFS_FS_PORT); + entry->servers[loop].transport.sin6.sin6_flowinfo = 0; + entry->servers[loop].transport.sin6.sin6_scope_id = 0; + entry->servers[loop].transport.sin6.sin6_addr.s6_addr32[0] = 0; + entry->servers[loop].transport.sin6.sin6_addr.s6_addr32[1] = 0; + entry->servers[loop].transport.sin6.sin6_addr.s6_addr32[2] = htonl(0xffff); + entry->servers[loop].transport.sin6.sin6_addr.s6_addr32[3] = *bp++; } bp += 8; /* partition IDs */ |