login
Header Space

 
 

Re: [GIT PULL net-2.6.26] [IPV6] MROUTE: Support multicast routing.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@...>
Cc: <davem@...>, <netdev@...>
Date: Saturday, April 5, 2008 - 6:48 am

Hi,

It seems to me that there is an error in this patch, when building on
64 machines.
It seems to me that this error will not occur when building on 32 machines,
though I did not verified this. It seems to me that the reason is that
the tail member of sk_buff  is declared as unsigned int when building
on 64 bit  machines, and is declared as unsigned char* when building
on 32 bit machines.

More details:
I had git-cloned this tree and change to the mroute-20080403 git branch
and tied to build when selecting the Multicast Routing for the build.
(CONFIG_IPV6_MROUTE=y), I had this compiler errors:
...
...
net/ipv6/ip6mr.c: In function 'ip6mr_cache_resolve':
net/ipv6/ip6mr.c:736: error: invalid operands to binary -
net/ipv6/ip6mr.c: In function 'ip6mr_fill_mroute':
net/ipv6/ip6mr.c:1565: warning: initialization makes pointer from
integer without a cast
net/ipv6/ip6mr.c:1585: error: invalid operands to binary -
make[2]: *** [net/ipv6/ip6mr.o] Error 1
make[1]: *** [net/ipv6] Error 2
make: *** [net] Error 2
...
...

Probing into the code revealed that the error in line 736 of net/ipv6/ip6mr.c
is due to:
 nlh->nlmsg_len = skb->tail - (u8 *)nlh;


It seems to me that this could be solved by calling skb_tail_pointer(), thus:
nlh->nlmsg_len = skb_tail_pointer(skb) - (u8 *)nlh;

( skb_tail_pointer() has two definition, depending on which machine we use,
32 or 64 bit; it is dependent upon BITS_PER_LONG value,which is eventually
dependent on whether CONFIG_X86_32 is set)

The same is for ip6mr_fill_mroute() in the same net/ipv6/ip6mr.c:
First, to avoid a compilation warning
 "warning: initialization makes pointer from integer without a cast"
 it should be
        u8 *b = skb_tail_pointer(skb)
instead of:
				u8 *b = skb->tail;
				
Second, to avoid a similrar compilation error it should be
        mp_head->rta_len = skb_tail_pointer(skb) - (u8 *)mp_head;
instead of:
	mp_head->rta_len = skb->tail - (u8 *)mp_head;

Regards,
Rami Rosen



On Thu, Apr 3, 2008 at 5:43 AM, YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@linux-ipv6.org> wrote:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PULL net-2.6.26] [IPV6] MROUTE: Support multicast routi..., YOSHIFUJI Hideaki / , (Wed Apr 2, 10:43 pm)
Re: [GIT PULL net-2.6.26] [IPV6] MROUTE: Support multicast r..., Rami Rosen, (Sat Apr 5, 6:48 am)
Re: [GIT PULL net-2.6.26] [IPV6] MROUTE: Support multicast r..., YOSHIFUJI Hideaki / , (Sat Apr 5, 9:46 am)
Re: [GIT PULL net-2.6.26] [IPV6] MROUTE: Support multicast r..., YOSHIFUJI Hideaki / , (Thu Apr 3, 2:23 am)
Re: [GIT PULL net-2.6.26] [IPV6] MROUTE: Support multicast r..., YOSHIFUJI Hideaki / , (Thu Apr 3, 3:31 am)
Re: [GIT PULL net-2.6.26] [IPV6] MROUTE: Support multicast r..., YOSHIFUJI Hideaki / , (Mon Apr 7, 10:37 am)
speck-geostationary