Cyril Wallois wrote: > Hello Jan , > >> Could you verify that sizeof(struct ipv4_cmd) gives the same results in > kernel and user space: > > In the kernel space the size is 56, against in the user space the size is > 52. > > Where should I add the definition of the structure, in rtping.c ? >
Please try this patch: diff --git a/stack/include/ipv4_chrdev.h b/stack/include/ipv4_chrdev.h index a96a8ad..fc1099b 100644 --- a/stack/include/ipv4_chrdev.h +++ b/stack/include/ipv4_chrdev.h @@ -67,10 +67,12 @@ struct ipv4_cmd { __u32 ip_addr; __u16 id; __u16 sequence; - size_t msg_size; - unsigned int timeout; + __u32 msg_size; + __u32 timeout; __s64 rtt; } ping; + + unsigned char padding[64]; } args; }; diff --git a/tools/rtping.c b/tools/rtping.c index 2178928..17309db 100644 --- a/tools/rtping.c +++ b/tools/rtping.c @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) exit(1); } - printf("Real-time PING %s %zd(%zd) bytes of data.\n", + printf("Real-time PING %s %d(%d) bytes of data.\n", inet_ntoa(addr), cmd.args.ping.msg_size, cmd.args.ping.msg_size + 28);
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users