On Mon, Aug 15, 2005 at 10:16:19AM +0200, Patrick McHardy ([EMAIL PROTECTED]) wrote: > Evgeniy Polyakov wrote: > >>+ nlk->groups[0] = (nlk->groups[0] & ~0xffffffffUL) | > >>nladdr->nl_groups; netlink_table_ungrab(); > > > > > >I have some doubt about 64bit platforms. > > We want to replace the lower 32 bit. What are the doubts you're haveing? > >> return 0; > >>@@ -590,7 +619,7 @@ static int netlink_getname(struct socket > >> nladdr->nl_groups = netlink_group_mask(nlk->dst_group); > >> } else { > >> nladdr->nl_pid = nlk->pid; > >>- nladdr->nl_groups = nlk->groups; > >>+ nladdr->nl_groups = nlk->groups[0]; > > > > > >And here too. > > > >nlk->groups[0] is an unsigned long, which is 64bit on 64bit platforms. > > So it will be truncated to 32bit, which is exactly what is intended > here. The problem Dave was refering to was a cast of unsigned long * > to u32 *, which doesn't work because it will use the upper 4 byte on > big-endian 64bit. But without pointer casts this should work well.
it's not Dave's bug, all this changes force compiler to scream, which thrusts forward. -- Evgeniy Polyakov - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html