public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash•net>
To: jamal <hadi@cyberus•ca>
Cc: timo.teras@iki•fi, herbert@gondor•apana.org.au,
	davem@davemloft•net, netdev@vger•kernel.org
Subject: Re: [net-next-2.6 PATCH 1/7] xfrm: introduce basic mark infrastructure
Date: Mon, 15 Feb 2010 16:42:40 +0100	[thread overview]
Message-ID: <4B796B70.2050102@trash.net> (raw)
In-Reply-To: <1266160732-946-2-git-send-email-hadi@cyberus.ca>

jamal wrote:
> +static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_kmark *m)
> +{
> +	if (attrs[XFRMA_MARK])
> +		memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(m));
> +	else
> +		m->v = m->m = 0;
> +
> +	return m->v & m->m;
> +}
> +
> +static inline int xfrm_mark_put(struct sk_buff *skb, struct xfrm_kmark *m)
> +{
> +	if (m->m & m->v)
> +		NLA_PUT(skb, XFRMA_MARK, sizeof(struct xfrm_kmark), m);

This doesn't look right. A mark value of 0 with a mask of ~0 won't
be properly dumped. I think this should check for (m->m | m->v).

> +	return 0;
> +
> +nla_put_failure:
> +	return -1;
> +}
> +
>  #endif	/* _NET_XFRM_H */


  parent reply	other threads:[~2010-02-15 15:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <xfrm-mark-net-next>
2010-02-14 15:18 ` [net-next-2.6 PATCH 0/7] xfrm by MARK jamal
2010-02-14 15:18   ` [net-next-2.6 PATCH 1/7] xfrm: introduce basic mark infrastructure jamal
2010-02-14 15:18     ` [net-next-2.6 PATCH 2/7] xfrm: SA lookups signature with mark jamal
2010-02-14 15:18       ` [net-next-2.6 PATCH 3/7] xfrm: SA lookups " jamal
2010-02-14 15:18         ` [net-next-2.6 PATCH 4/7] xfrm: SP lookups signature " jamal
2010-02-14 15:18           ` [net-next-2.6 PATCH 5/7] xfrm: SP lookups " jamal
2010-02-14 15:18             ` [net-next-2.6 PATCH 6/7] xfrm: Allow user space config of SAD mark jamal
2010-02-14 15:18               ` [net-next-2.6 PATCH 7/7] xfrm: Allow user space manipulation of SPD mark jamal
2010-02-15 15:42     ` Patrick McHardy [this message]
2010-02-15 17:00       ` [net-next-2.6 PATCH 1/7] xfrm: introduce basic mark infrastructure jamal
2010-02-15 17:06         ` Patrick McHardy
2010-02-15 17:14           ` jamal
2010-02-15 17:21             ` Patrick McHardy
2010-02-15 18:59               ` jamal
2010-02-16 10:43             ` Benny Amorsen
2010-02-16 11:57               ` jamal
2010-02-16 12:59                 ` Benny Amorsen
2010-02-16 13:16                   ` jamal
2010-02-16 21:56                     ` Benny Amorsen
2010-02-17 11:58                       ` jamal
     [not found] <xfrm-mark-take2>
2010-02-20 20:55 ` [net-next-2.6 PATCH 0/7] xfrm by MARK jamal
2010-02-20 20:55   ` [net-next-2.6 PATCH 1/7] xfrm: introduce basic mark infrastructure jamal
2010-02-22  6:26     ` David Miller
2010-02-22 14:09       ` jamal
     [not found] <xfrm-mark-v3>
2010-02-22 21:32 ` [net-next-2.6 PATCH 0/7] xfrm by MARK jamal
2010-02-22 21:32   ` [net-next-2.6 PATCH 1/7] xfrm: introduce basic mark infrastructure jamal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B796B70.2050102@trash.net \
    --to=kaber@trash$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=hadi@cyberus$(echo .)ca \
    --cc=herbert@gondor$(echo .)apana.org.au \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=timo.teras@iki$(echo .)fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox