]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[TCP] MD5: Remove some more unnecessary casting.
authorMatthias M. Dellweg <2500@gmx.de>
Tue, 30 Oct 2007 03:55:27 +0000 (20:55 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 30 Oct 2007 05:37:27 +0000 (22:37 -0700)
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: Matthias M. Dellweg <2500@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c

index ad759f1c377734bf252a25422e136c275f132312..d3d8d5dfcee3dc593e956042bc198da965f56f17 100644 (file)
@@ -858,16 +858,16 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
                      u8 *newkey, u8 newkeylen)
 {
        /* Add Key to the list */
-       struct tcp4_md5sig_key *key;
+       struct tcp_md5sig_key *key;
        struct tcp_sock *tp = tcp_sk(sk);
        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) {
                /* Pre-existing entry - just update that one. */
-               kfree(key->base.key);
-               key->base.key = newkey;
-               key->base.keylen = newkeylen;
+               kfree(key->key);
+               key->key = newkey;
+               key->keylen = newkeylen;
        } else {
                struct tcp_md5sig_info *md5sig;
 
index 85208026278b5a217123656a8c90e2ed25c93d46..f1523b82cac194f603f1b743cdd92ae80d55e3a4 100644 (file)
@@ -561,16 +561,16 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,
                             char *newkey, u8 newkeylen)
 {
        /* Add key to the list */
-       struct tcp6_md5sig_key *key;
+       struct tcp_md5sig_key *key;
        struct tcp_sock *tp = tcp_sk(sk);
        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) {
                /* modify existing entry - just update that one */
-               kfree(key->base.key);
-               key->base.key = newkey;
-               key->base.keylen = newkeylen;
+               kfree(key->key);
+               key->key = newkey;
+               key->keylen = newkeylen;
        } else {
                /* reallocate new list if current one is full. */
                if (!tp->md5sig_info) {