Hi Kurt, Kurt Van Dijck wrote: > Hi, > > I'm working on a j1939 socket type (not sure our managament will allow > us to open source it, we're working on that too). > During that development, we added an extra entry in > struct sockaddr_can.can_addr. > ---- > > Our extension does increase the size of struct sockaddr_can > This patch solves a problem that 'regular' socket types > do require the full struct sockaddr_can be present, while using only the > first few fields. > > It does so by not testing on sizeof() but using a newly introduced macro > 'partial_struct_size', which returns the size of the struct up to the > requested struct member. > When socketcan is compiled with bigger struct sockaddr_can, It will not > pose any problems with userspace binaries that got compiled with older > revisions of struct sockaddr_can. > Please not that the 'partial_struct_size' macro can only work when the > struct in only added to, not modified, which is the case here. > > Signed-off-by: Kurt Van Dijck <[email protected]>
Looks special. Is the problem not solve with unions? Anyhow, there is no user of this code. Why should we add it? Wolfgang. _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
