Commit b0a713e9 authored by Matthias M. Dellweg's avatar Matthias M. Dellweg Committed by David S. Miller

[TCP] MD5: Remove some more unnecessary casting.

while reviewing the tcp_md5-related code further i came across with
another two of these casts which you probably have missed. I don't
actually think that they impose a problem by now, but as you said we
should remove them.
Signed-off-by: default avatarMatthias M. Dellweg <2500@gmx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c940587b
...@@ -858,16 +858,16 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, ...@@ -858,16 +858,16 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
u8 *newkey, u8 newkeylen) u8 *newkey, u8 newkeylen)
{ {
/* Add Key to the list */ /* Add Key to the list */
struct tcp4_md5sig_key *key; struct tcp_md5sig_key *key;
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
struct tcp4_md5sig_key *keys; struct tcp4_md5sig_key *keys;
key = (struct tcp4_md5sig_key *)tcp_v4_md5_do_lookup(sk, addr); key = tcp_v4_md5_do_lookup(sk, addr);
if (key) { if (key) {
/* Pre-existing entry - just update that one. */ /* Pre-existing entry - just update that one. */
kfree(key->base.key); kfree(key->key);
key->base.key = newkey; key->key = newkey;
key->base.keylen = newkeylen; key->keylen = newkeylen;
} else { } else {
struct tcp_md5sig_info *md5sig; struct tcp_md5sig_info *md5sig;
......
...@@ -561,16 +561,16 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, ...@@ -561,16 +561,16 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,
char *newkey, u8 newkeylen) char *newkey, u8 newkeylen)
{ {
/* Add key to the list */ /* Add key to the list */
struct tcp6_md5sig_key *key; struct tcp_md5sig_key *key;
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
struct tcp6_md5sig_key *keys; struct tcp6_md5sig_key *keys;
key = (struct tcp6_md5sig_key*) tcp_v6_md5_do_lookup(sk, peer); key = tcp_v6_md5_do_lookup(sk, peer);
if (key) { if (key) {
/* modify existing entry - just update that one */ /* modify existing entry - just update that one */
kfree(key->base.key); kfree(key->key);
key->base.key = newkey; key->key = newkey;
key->base.keylen = newkeylen; key->keylen = newkeylen;
} else { } else {
/* reallocate new list if current one is full. */ /* reallocate new list if current one is full. */
if (!tp->md5sig_info) { if (!tp->md5sig_info) {
......
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