> I forget what the rules are exactly, but you might technically need
> to m_pulldown() before you're allowed to mtod for such a large
> structure.

I've looked some more through existing code (and searched nxr for users of
m_pulldown()) and it doesn't look like it ...

> 
> >+    sin6->sin6_len = nam->m_len = sizeof (*sin6);
> 
> Don't you need to set nam->m_pkthdr.len?

Cross-checked now against also tftproot_getfile() and it doesn't do this
for "nam", only for "m" (which i do).

> KASSERT() that rslen <= MCLBYTES is a good idea.  Actually, can be a
> CTASSERT()

Adding CTASSERT(rslen <= MCLBYTES); results in a totally unintelligible set
of build errors:

dependall ===> 
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:
 In function 'rump_netconfig_auto_ipv6_oneshot':
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:350:3:
 error: jump into scope of identifier with variably modified type
   goto out;
   ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:404:1:
 note: label 'out' defined here
 out:
 ^
In file included from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/stdint.h:35:0,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/inttypes.h:39,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/param.h:100,
                 from 
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:26:
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:39:
 note: '__ctassert6' declared here
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                                       ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:153:43:
 note: in definition of macro '__CTASSERT1'
 #define __CTASSERT1(x, y, z) typedef char y ## z[/*CONSTCOND*/(x) ? 1 : -1] 
__unused
                                           ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:24:
 note: in expansion of macro '__CTASSERT0'
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                        ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../lib/libkern/libkern.h:249:22:
 note: in expansion of macro '__CTASSERT'
 #define CTASSERT(x)  __CTASSERT(x)
                      ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:378:2:
 note: in expansion of macro 'CTASSERT'
  CTASSERT(rslen <= MCLBYTES);
  ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:354:3:
 error: jump into scope of identifier with variably modified type
   goto out;
   ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:404:1:
 note: label 'out' defined here
 out:
 ^
In file included from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/stdint.h:35:0,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/inttypes.h:39,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/param.h:100,
                 from 
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:26:
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:39:
 note: '__ctassert6' declared here
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                                       ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:153:43:
 note: in definition of macro '__CTASSERT1'
 #define __CTASSERT1(x, y, z) typedef char y ## z[/*CONSTCOND*/(x) ? 1 : -1] 
__unused
                                           ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:24:
 note: in expansion of macro '__CTASSERT0'
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                        ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../lib/libkern/libkern.h:249:22:
 note: in expansion of macro '__CTASSERT'
 #define CTASSERT(x)  __CTASSERT(x)
                      ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:378:2:
 note: in expansion of macro 'CTASSERT'
  CTASSERT(rslen <= MCLBYTES);
  ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:359:3:
 error: jump into scope of identifier with variably modified type
   goto out;
   ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:404:1:
 note: label 'out' defined here
 out:
 ^
In file included from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/stdint.h:35:0,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/inttypes.h:39,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/param.h:100,
                 from 
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:26:
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:39:
 note: '__ctassert6' declared here
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                                       ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:153:43:
 note: in definition of macro '__CTASSERT1'
 #define __CTASSERT1(x, y, z) typedef char y ## z[/*CONSTCOND*/(x) ? 1 : -1] 
__unused
                                           ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:24:
 note: in expansion of macro '__CTASSERT0'
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                        ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../lib/libkern/libkern.h:249:22:
 note: in expansion of macro '__CTASSERT'
 #define CTASSERT(x)  __CTASSERT(x)
                      ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:378:2:
 note: in expansion of macro 'CTASSERT'
  CTASSERT(rslen <= MCLBYTES);
  ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:364:3:
 error: jump into scope of identifier with variably modified type
   goto out;
   ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:404:1:
 note: label 'out' defined here
 out:
 ^
In file included from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/stdint.h:35:0,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/inttypes.h:39,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/param.h:100,
                 from 
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:26:
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:39:
 note: '__ctassert6' declared here
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                                       ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:153:43:
 note: in definition of macro '__CTASSERT1'
 #define __CTASSERT1(x, y, z) typedef char y ## z[/*CONSTCOND*/(x) ? 1 : -1] 
__unused
                                           ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:24:
 note: in expansion of macro '__CTASSERT0'
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                        ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../lib/libkern/libkern.h:249:22:
 note: in expansion of macro '__CTASSERT'
 #define CTASSERT(x)  __CTASSERT(x)
                      ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:378:2:
 note: in expansion of macro 'CTASSERT'
  CTASSERT(rslen <= MCLBYTES);
  ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:368:3:
 error: jump into scope of identifier with variably modified type
   goto out;
   ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:404:1:
 note: label 'out' defined here
 out:
 ^
In file included from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/stdint.h:35:0,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/inttypes.h:39,
                 from 
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/param.h:100,
                 from 
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:26:
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:39:
 note: '__ctassert6' declared here
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                                       ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:153:43:
 note: in definition of macro '__CTASSERT1'
 #define __CTASSERT1(x, y, z) typedef char y ## z[/*CONSTCOND*/(x) ? 1 : -1] 
__unused
                                           ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../sys/cdefs.h:146:24:
 note: in expansion of macro '__CTASSERT0'
 #define __CTASSERT(x)  __CTASSERT0(x, __ctassert, __COUNTER__)
                        ^
/home/mato/projects/rumpkernel/rumprun/src-netbsd/sys/rump/../lib/libkern/libkern.h:249:22:
 note: in expansion of macro '__CTASSERT'
 #define CTASSERT(x)  __CTASSERT(x)
                      ^
/home/mato/projects/rumpkernel/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:378:2:
 note: in expansion of macro 'CTASSERT'
  CTASSERT(rslen <= MCLBYTES);
  ^
*** [netconfig.o] Error code 1


Reply via email to