Claudio Jeker <[email protected]> wrote: > > union sockunion { > > struct sockaddr sa; > > struct sockaddr_in sin; > > @@ -26,6 +38,7 @@ union sockunion { > > struct sockaddr_dl sdl; > > struct sockaddr_rtlabel rtlabel; > > struct sockaddr_mpls smpls; > > + char padding[ROUNDUP(SAMAXSIZE)]; > > Just throw a struct sockaddr_storage in that union. It will make sure > there is enough space for everything and then you can skip the MAXIMUM > dance you do now.
yes, that is the right way to do it. it is done in other places also.
