netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: "Grégoire Baron" <baronchon@n7mm.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v2] net/sched: add ACT_CSUM action to update packets checksums
Date: Wed, 18 Aug 2010 06:52:10 -0400	[thread overview]
Message-ID: <1282128730.23601.11.camel@bigi> (raw)
In-Reply-To: <20100817235952.GB24125@n7mm.org>

On Wed, 2010-08-18 at 01:59 +0200, Grégoire Baron wrote:


> +static int tcf_csum_ipv4_icmp(struct sk_buff *skb,
> +			      unsigned int ihl, unsigned int ipl)
> +{
> +	struct icmphdr *icmph;
> +
> +	icmph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*icmph));
> +	if (icmph == NULL)
> +		goto fail;
                  ^^^^^^^^^^^
> +	icmph->checksum = 0;
> +	skb->csum = csum_partial(icmph, ipl - ihl, 0);
> +	icmph->checksum = csum_fold(skb->csum);
> +
> +	skb->ip_summed = CHECKSUM_NONE;
> +
> +	return 1;
> +
> +fail:
> +	return 0;
> +}
> +

I think you missed one of my earlier comments:
Do you really need this goto? You should just "return 0" instead of
"goto fail"
Same with many other similar places where the "fail:" just simply
returns 0 such as igmp, ipv6_icmp, ipv4_udp, etc

BTW, i still think there may be a clever way to unify things - but we
can leave that for another day;-> If you fix the above please add
my Acked-by.

cheers,
jamal


      reply	other threads:[~2010-08-18 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17 23:59 [PATCH v2] net/sched: add ACT_CSUM action to update packets checksums Grégoire Baron
2010-08-18 10:52 ` jamal [this message]

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=1282128730.23601.11.camel@bigi \
    --to=hadi@cyberus.ca \
    --cc=baronchon@n7mm.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).