Re: [PATCH 14/16] [XFRM] netlink: Use nla_memcpy() in xfrm_update_ae_params()

2007-08-22 Thread David Miller
From: Thomas Graf <[EMAIL PROTECTED]>
Date: Wed, 22 Aug 2007 16:55:52 +0200

> Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Applied.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/16] [XFRM] netlink: Use nla_memcpy() in xfrm_update_ae_params()

2007-08-22 Thread Thomas Graf
Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.24/net/xfrm/xfrm_user.c
===
--- net-2.6.24.orig/net/xfrm/xfrm_user.c2007-08-21 17:35:13.0 
+0200
+++ net-2.6.24/net/xfrm/xfrm_user.c 2007-08-21 17:36:59.0 +0200
@@ -303,20 +303,12 @@ static void xfrm_update_ae_params(struct
struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH];
 
if (rp) {
-   struct xfrm_replay_state *replay;
-   replay = nla_data(rp);
-   memcpy(&x->replay, replay, sizeof(*replay));
-   memcpy(&x->preplay, replay, sizeof(*replay));
+   nla_memcpy(&x->replay, rp, sizeof(x->replay));
+   nla_memcpy(&x->preplay, rp, sizeof(x->preplay));
}
 
-   if (lt) {
-   struct xfrm_lifetime_cur *ltime;
-   ltime = nla_data(lt);
-   x->curlft.bytes = ltime->bytes;
-   x->curlft.packets = ltime->packets;
-   x->curlft.add_time = ltime->add_time;
-   x->curlft.use_time = ltime->use_time;
-   }
+   if (lt)
+   nla_memcpy(&x->curlft, lt, sizeof(x->curlft));
 
if (et)
x->replay_maxage = nla_get_u32(et);

-- 

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html