All of lore.kernel.org
 help / color / mirror / Atom feed
* Missing csum_fold() in ip6t_HL.c ?
@ 2006-09-15 10:37 Alexey Dobriyan
  2006-09-15 20:19 ` Patrick McHardy
  2007-02-12 14:47 ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 2 replies; 5+ messages in thread
From: Alexey Dobriyan @ 2006-09-15 10:37 UTC (permalink / raw)
  To: netdev; +Cc: netfilter-devel

It looks like "diffs" array is write-only. It also looks like ipv4
occurences use some csum_fold() trickery. Was is forgotten here? Should
"diffs" be removed?

    20	static unsigned int ip6t_hl_target(struct sk_buff **pskb,
    21					   const struct net_device *in,
    22					   const struct net_device *out,
    23					   unsigned int hooknum,
    24					   const struct xt_target *target,
    25					   const void *targinfo, void *userinfo)
    26	{
    27		struct ipv6hdr *ip6h;
    28		const struct ip6t_HL_info *info = targinfo;
    29	===>	u_int16_t diffs[2];	<===
    30		int new_hl;
    31
    32		if (!skb_make_writable(pskb, (*pskb)->len))
    33			return NF_DROP;
    34
    35		ip6h = (*pskb)->nh.ipv6h;
    36
    37		switch (info->mode) {
    38			case IP6T_HL_SET:
    39				new_hl = info->hop_limit;
    40				break;
    41			case IP6T_HL_INC:
    42				new_hl = ip6h->hop_limit + info->hop_limit;
    43				if (new_hl > 255)
    44					new_hl = 255;
    45				break;
    46			case IP6T_HL_DEC:
    47				new_hl = ip6h->hop_limit - info->hop_limit;
    48				if (new_hl < 0)
    49					new_hl = 0;
    50				break;
    51			default:
    52				new_hl = ip6h->hop_limit;
    53				break;
    54		}
    55
    56		if (new_hl != ip6h->hop_limit) {
    57	===>		diffs[0] = htons(((unsigned)ip6h->hop_limit) << 8) ^ 0xFFFF;
    58			ip6h->hop_limit = new_hl;
    59	===>		diffs[1] = htons(((unsigned)ip6h->hop_limit) << 8);
    60		}
    61
    62		return IP6T_CONTINUE;
    63	}


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Missing csum_fold() in ip6t_HL.c ?
  2006-09-15 10:37 Missing csum_fold() in ip6t_HL.c ? Alexey Dobriyan
@ 2006-09-15 20:19 ` Patrick McHardy
  2007-02-12 14:47 ` YOSHIFUJI Hideaki / 吉藤英明
  1 sibling, 0 replies; 5+ messages in thread
From: Patrick McHardy @ 2006-09-15 20:19 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: netdev, netfilter-devel

Alexey Dobriyan wrote:
> It looks like "diffs" array is write-only. It also looks like ipv4
> occurences use some csum_fold() trickery. Was is forgotten here? Should
> "diffs" be removed?

Yes, I've queued a patch to remove it. Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Missing csum_fold() in ip6t_HL.c ?
  2006-09-15 10:37 Missing csum_fold() in ip6t_HL.c ? Alexey Dobriyan
  2006-09-15 20:19 ` Patrick McHardy
@ 2007-02-12 14:47 ` YOSHIFUJI Hideaki / 吉藤英明
  2007-02-12 14:52   ` Patrick McHardy
  1 sibling, 1 reply; 5+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-02-12 14:47 UTC (permalink / raw)
  To: adobriyan; +Cc: netdev, netfilter-devel, yoshfuji

In article <20060915103755.GB5286@martell.zuzino.mipt.ru> (at Fri, 15 Sep 2006 14:37:56 +0400), Alexey Dobriyan <adobriyan@gmail.com> says:

> It looks like "diffs" array is write-only. It also looks like ipv4
> occurences use some csum_fold() trickery. Was is forgotten here? Should
> "diffs" be removed?

Since we do not have checksum in IPv6 header, we do not need to
adjust checksum when we touch hoplimit.

So, just removing it should be safe.

--yoshfuji

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Missing csum_fold() in ip6t_HL.c ?
  2007-02-12 14:47 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2007-02-12 14:52   ` Patrick McHardy
  2007-02-12 15:01     ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick McHardy @ 2007-02-12 14:52 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev, netfilter-devel, adobriyan

YOSHIFUJI Hideaki / ^[$B5HF#1QL@^[ wrote:
> In article <20060915103755.GB5286@martell.zuzino.mipt.ru> (at Fri, 15 Sep 2006 14:37:56 +0400), Alexey Dobriyan <adobriyan@gmail.com> says:
> 
> 
>>It looks like "diffs" array is write-only. It also looks like ipv4
>>occurences use some csum_fold() trickery. Was is forgotten here? Should
>>"diffs" be removed?
> 
> 
> Since we do not have checksum in IPv6 header, we do not need to
> adjust checksum when we touch hoplimit.
> 
> So, just removing it should be safe.


This already is taken care of. I noticed our listmaster didn't
approve any held messages for a couple of month and am currently
going through the backlog (Alexey's mail is quite old).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Missing csum_fold() in ip6t_HL.c ?
  2007-02-12 14:52   ` Patrick McHardy
@ 2007-02-12 15:01     ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 0 replies; 5+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-02-12 15:01 UTC (permalink / raw)
  To: kaber; +Cc: netdev, netfilter-devel, adobriyan

In article <45D07F1D.7030202@trash.net> (at Mon, 12 Feb 2007 15:52:13 +0100), Patrick McHardy <kaber@trash.net> says:

> This already is taken care of. I noticed our listmaster didn't
> approve any held messages for a couple of month and am currently
> going through the backlog (Alexey's mail is quite old).

Argh, okay.  Thanks.

--yoshfuji

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-12 15:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-15 10:37 Missing csum_fold() in ip6t_HL.c ? Alexey Dobriyan
2006-09-15 20:19 ` Patrick McHardy
2007-02-12 14:47 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-12 14:52   ` Patrick McHardy
2007-02-12 15:01     ` YOSHIFUJI Hideaki / 吉藤英明

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.