Patchwork sctp/ipv6.c: use ipv6_addr_copy

login
register
mail settings
Submitter Joe Perches
Date Jan. 22, 2009, 9:08 p.m.
Message ID <1232658506.15489.63.camel@localhost>
Download mbox | patch
Permalink /patch/19895/
State Accepted
Delegated to: David Miller
Headers show

Comments

Joe Perches - Jan. 22, 2009, 9:08 p.m.
Signed-off-by: Joe Perches <joe@perches.com>



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vlad Yasevich - Jan. 22, 2009, 9:18 p.m.
Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> 
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index ceaa4aa..7862275 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -97,8 +97,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
>  		if (addr) {
>  			addr->a.v6.sin6_family = AF_INET6;
>  			addr->a.v6.sin6_port = 0;
> -			memcpy(&addr->a.v6.sin6_addr, &ifa->addr,
> -				 sizeof(struct in6_addr));
> +			ipv6_addr_copy(&addr->a.v6.sin6_addr, &ifa->addr);
>  			addr->a.v6.sin6_scope_id = ifa->idev->dev->ifindex;
>  			addr->valid = 1;
>  			spin_lock_bh(&sctp_local_addr_lock);
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

ACK.  Simple enough of a cleanup.

-vlad
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Jan. 22, 2009, 9:50 p.m.
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Thu, 22 Jan 2009 16:18:43 -0500

> Joe Perches wrote:
> > Signed-off-by: Joe Perches <joe@perches.com>
 ...
> ACK.  Simple enough of a cleanup.

Applied to net-next-2.6, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index ceaa4aa..7862275 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -97,8 +97,7 @@  static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
 		if (addr) {
 			addr->a.v6.sin6_family = AF_INET6;
 			addr->a.v6.sin6_port = 0;
-			memcpy(&addr->a.v6.sin6_addr, &ifa->addr,
-				 sizeof(struct in6_addr));
+			ipv6_addr_copy(&addr->a.v6.sin6_addr, &ifa->addr);
 			addr->a.v6.sin6_scope_id = ifa->idev->dev->ifindex;
 			addr->valid = 1;
 			spin_lock_bh(&sctp_local_addr_lock);