We have a problem with CAN control requests piggybacking on struct ifreq
for passing arguments to the raw driver. This is unsafe, since we have
no mean to relate sizeof(ifr.ifr_ifru) to the actual size required to
pass the CAN-related arguments to the ioctl handler, so we are currently
hopping for the best.

In addition, all rtcan utilities are causing recent compilers here to
complain loudly about potential aliasing issues when mapping those
arguments over the ifr_ifru area using casts, which is unfortunately true.

So I came up with a general fix, introducing struct can_ifreq for this
purpose. Applications passing struct ifreq should still work (well, that
is the plan) since sizeof(struct ifreq) >= sizeof(struct can_ifreq) and
all member offsets within ifr_ifru have been preserved. Could the CAN
maintainers please review this code and comment?

Thanks,

http://git.xenomai.org/xenomai-3.git/commit/?h=next&id=5460e09d0f990799fb2eed67fbb00358860ebcab

-- 
Philippe.

_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai

Reply via email to