Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Dec 2006 17:50:11 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/net if_llc.h
Message-ID:  <200612011750.kB1HoBnP096579@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
imp         2006-12-01 17:50:11 UTC

  FreeBSD src repository

  Modified files:
    sys/net              if_llc.h 
  Log:
  Move the __packed declarations.  This makes sizeof(struct llc) 8 again
  on the arm.  Add an assert to ensure that the size is 8 to prefent others
  from falling into this trap (we should have more of these).
  
  Why the construct:
  
          struct foo {
                  union bar {
                          struct {
                                  ...
                          } __packed fred;
                          ...
                  } __packed wilma;
          } __packed;
  
  has a different packing than:
  
          struct foo {
                  union bar {
                          struct {
                                  ...
                          } fred __packed;
                          ...
                  } wilma __packed;
          } __packed;
  
  is beyond my ability to ferret out of the gcc documentation.  Most
  likely some subtle binding issue (eg before it says the struct itself
  is packed, while after it means that the whole struct is packed into
  the thing it is in).  Pointers to relevant documentation would be
  appreciated.
  
  Revision  Changes    Path
  1.13      +11 -7     src/sys/net/if_llc.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612011750.kB1HoBnP096579>