xfrm: fix XFRMA_MARK extraction in xfrm_mark_get
Subsystems (3)
PATCH 1/1 xfrm: fix XFRMA_MARK extraction in xfrm_mark_get
Determine the size of the xfrm_mark struct, not of its pointer.
Signed-off-by Andreas Steffen <[email protected]>
--- include/net/xfrm.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/net/xfrm.h +1 -1
@@ -1586,7 +1586,7 @@ static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb)static inline int xfrm_mark_get (struct nlattr **attrs,struct xfrm_mark *m) {if (attrs[XFRMA_MARK ]) -memcpy (m,nla_data (attrs[XFRMA_MARK ]),sizeof (m)); +memcpy (m,nla_data (attrs[XFRMA_MARK ]),sizeof (struct xfrm_mark ));else m->v = m->m =0 ;
Signature · 1 line
1.7.0.4
Quoted 3 lines · Andreas Steffen
Determine the size of the
xfrm_markstruct, not of its pointer.Signed-off-by Andreas Steffen <[email protected]>
Good catch (you are right this was tested on 64 bit ;->). The preferred style would be what Simon mentioned. No biggie if you keep it this way - but if you resubmit, add:
Acked-by Jamal Hadi Salim <[email protected]>
cheers,
jamal
From: Andreas Steffen <[email protected]>
Date: Wed, 30 Jun 2010 09:57:34 +0200
Quoted 3 lines
Determine the size of the
xfrm_markstruct, not of its pointer.Signed-off-by Andreas Steffen <[email protected]>
Applied, thanks.