Re: [NETLINK 8/10]: Support dynamic number of multicast groups per netlink family
Evgeniy Polyakov wrote: + nlk-groups[0] = (nlk-groups[0] ~0xUL) | 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. - 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
Re: [NETLINK 8/10]: Support dynamic number of multicast groups per netlink family
On Mon, Aug 15, 2005 at 10:16:19AM +0200, Patrick McHardy ([EMAIL PROTECTED]) wrote: Evgeniy Polyakov wrote: + nlk-groups[0] = (nlk-groups[0] ~0xUL) | 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
Re: [NETLINK 8/10]: Support dynamic number of multicast groups per netlink family
Evgeniy Polyakov wrote: it's not Dave's bug, all this changes force compiler to scream, which thrusts forward. I don't get any compiler warnings with gcc-4.0.1 on x86 and amd64, so could you please be more specific? - 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
Re: [NETLINK 8/10]: Support dynamic number of multicast groups per netlink family
On Mon, Aug 15, 2005 at 11:06:27AM +0200, Patrick McHardy ([EMAIL PROTECTED]) wrote: Evgeniy Polyakov wrote: it's not Dave's bug, all this changes force compiler to scream, which thrusts forward. I don't get any compiler warnings with gcc-4.0.1 on x86 and amd64, so could you please be more specific? My fault, it was my changes on top of yours about which compiler warns :) Sorry for that. unsigned long can be transformed into any type safely. -- 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