diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2017-11-04 11:01:28 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2017-11-04 11:01:28 +0000 |
commit | 05b76f11527e17c2a5fc05557fd3bc3283934182 (patch) | |
tree | b981f6452e142333dd2d4e077a733383f74bc745 /sys/arch/octeon | |
parent | 9c925586956beb7054b607b3b08b79ad236bba12 (diff) |
Check buffer size parameters at compile time.
Diffstat (limited to 'sys/arch/octeon')
-rw-r--r-- | sys/arch/octeon/dev/if_cnmac.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/octeon/dev/if_cnmac.c b/sys/arch/octeon/dev/if_cnmac.c index 642fefcf409..352ccadc2f5 100644 --- a/sys/arch/octeon/dev/if_cnmac.c +++ b/sys/arch/octeon/dev/if_cnmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cnmac.c,v 1.66 2017/11/04 10:59:43 visa Exp $ */ +/* $OpenBSD: if_cnmac.c,v 1.67 2017/11/04 11:01:27 visa Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -104,6 +104,8 @@ (((uint32_t)OCTEON_POOL_SIZE_CMD / sizeof(uint64_t)) - 1) #define FPA_COMMAND_BUFFER_POOL_NWORDS OCTEON_POOL_NWORDS_CMD /* XXX */ +CTASSERT(MCLBYTES >= OCTEON_POOL_SIZE_PKT + CACHELINESIZE); + void octeon_eth_buf_init(struct octeon_eth_softc *); int octeon_eth_match(struct device *, void *, void *); @@ -243,8 +245,6 @@ octeon_eth_attach(struct device *parent, struct device *self, void *aux) struct ifnet *ifp = &sc->sc_arpcom.ac_if; uint8_t enaddr[ETHER_ADDR_LEN]; - KASSERT(MCLBYTES >= OCTEON_POOL_SIZE_PKT + CACHELINESIZE); - if (octeon_eth_npowgroups >= OCTEON_POW_GROUP_MAX) { printf(": out of POW groups\n"); return; |