lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1282128730.23601.11.camel@bigi>
Date:	Wed, 18 Aug 2010 06:52:10 -0400
From:	jamal <hadi@...erus.ca>
To:	Grégoire Baron <baronchon@...m.org>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH v2] net/sched: add ACT_CSUM action to update packets
 checksums

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ