Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1350448
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 10/13] rxrpc: rxkad: The version number in the response should be net byte order |
| Date | 2016-03-04 17:40 +0100 |
| Message-ID | <r90VI-14h-39@gated-at.bofh.it> (permalink) |
| References | <r90VH-14h-7@gated-at.bofh.it> |
| Organization | Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 |
The version number rxkad places in the response should be network byte order. Whilst we're at it, rearrange the code to be more readable. Signed-off-by: David Howells <dhowells@redhat.com> --- net/rxrpc/rxkad.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 0f27524536bd..ca746f382517 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -787,10 +787,15 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, /* build the response packet */ memset(&resp, 0, sizeof(resp)); - resp.version = RXKAD_VERSION; - resp.encrypted.epoch = htonl(conn->epoch); - resp.encrypted.cid = htonl(conn->cid); - resp.encrypted.securityIndex = htonl(conn->security_ix); + resp.version = htonl(RXKAD_VERSION); + resp.encrypted.epoch = htonl(conn->epoch); + resp.encrypted.cid = htonl(conn->cid); + resp.encrypted.securityIndex = htonl(conn->security_ix); + resp.encrypted.inc_nonce = htonl(nonce + 1); + resp.encrypted.level = htonl(conn->security_level); + resp.kvno = htonl(token->kad->kvno); + resp.ticket_len = htonl(token->kad->ticket_len); + resp.encrypted.call_id[0] = htonl(conn->channels[0] ? conn->channels[0]->call_id : 0); resp.encrypted.call_id[1] = @@ -799,10 +804,6 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, htonl(conn->channels[2] ? conn->channels[2]->call_id : 0); resp.encrypted.call_id[3] = htonl(conn->channels[3] ? conn->channels[3]->call_id : 0); - resp.encrypted.inc_nonce = htonl(nonce + 1); - resp.encrypted.level = htonl(conn->security_level); - resp.kvno = htonl(token->kad->kvno); - resp.ticket_len = htonl(token->kad->ticket_len); /* calculate the response checksum and then do the encryption */ rxkad_calc_response_checksum(&resp);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/13] RxRPC: Rewrite part 1 David Howells <dhowells@redhat.com> - 2016-03-04 17:40 +0100
[PATCH 02/13] rxrpc: Convert call flag and event numbers into enums David Howells <dhowells@redhat.com> - 2016-03-04 17:40 +0100
[PATCH 10/13] rxrpc: rxkad: The version number in the response should be net byte order David Howells <dhowells@redhat.com> - 2016-03-04 17:40 +0100
[PATCH 06/13] rxrpc: Fix defined range for /proc/sys/net/rxrpc/rx_mtu David Howells <dhowells@redhat.com> - 2016-03-04 17:50 +0100
[PATCH 08/13] rxrpc: Adjust some whitespace and comments David Howells <dhowells@redhat.com> - 2016-03-04 17:50 +0100
Re: [PATCH 00/13] RxRPC: Rewrite part 1 David Miller <davem@davemloft.net> - 2016-03-04 23:30 +0100
Re: [PATCH 00/13] RxRPC: Rewrite part 1 David Howells <dhowells@redhat.com> - 2016-03-04 23:40 +0100
Re: [PATCH 00/13] RxRPC: Rewrite part 1 David Miller <davem@davemloft.net> - 2016-03-05 00:30 +0100
csiph-web