diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 5f79e2de26d..8cdb9a472bd 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -946,7 +946,7 @@ int nrf_wifi_if_get_config_zep(const struct device *dev, struct ethernet_config *config) { int ret = -1; -#ifdef CONFIG_NRF70_RAW_DATA_TX + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; @@ -986,11 +986,12 @@ int nrf_wifi_if_get_config_zep(const struct device *dev, } memset(config, 0, sizeof(struct ethernet_config)); - +#ifdef CONFIG_NRF70_RAW_DATA_TX if (type == ETHERNET_CONFIG_TYPE_TXINJECTION_MODE) { config->txinjection_mode = sys_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx]->txinjection_mode; } +#endif #ifdef CONFIG_NRF70_TCP_IP_CHECKSUM_OFFLOAD if (type == ETHERNET_CONFIG_TYPE_TX_CHECKSUM_SUPPORT || type == ETHERNET_CONFIG_TYPE_RX_CHECKSUM_SUPPORT) { @@ -1011,7 +1012,6 @@ int nrf_wifi_if_get_config_zep(const struct device *dev, unlock: k_mutex_unlock(&vif_ctx_zep->vif_lock); out: -#endif return ret; } diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c index 792e9f12a9f..675ca9d2b34 100644 --- a/subsys/net/ip/net_pkt.c +++ b/subsys/net/ip/net_pkt.c @@ -970,7 +970,7 @@ static struct net_buf *pkt_alloc_buffer(struct net_pkt *pkt, size = 0U; } else { - size -= current->size; + size -= current->size - headroom; } } else { if (current->size > size) { @@ -1033,13 +1033,12 @@ static struct net_buf *pkt_alloc_buffer(struct net_pkt *pkt, #if defined(CONFIG_NET_PKT_ALLOC_STATS) uint32_t start_time = k_cycle_get_32(); - size_t total_size = size; + size_t total_size = size + headroom; #else ARG_UNUSED(pkt); #endif - ARG_UNUSED(headroom); - buf = net_buf_alloc_len(pool, size, timeout); + buf = net_buf_alloc_len(pool, size + headroom, timeout); #if CONFIG_NET_PKT_LOG_LEVEL >= LOG_LEVEL_DBG NET_FRAG_CHECK_IF_NOT_IN_USE(buf, buf->ref + 1); diff --git a/tests/net/vlan/testcase.yaml b/tests/net/vlan/testcase.yaml index c036e767a40..97f637bd3f1 100644 --- a/tests/net/vlan/testcase.yaml +++ b/tests/net/vlan/testcase.yaml @@ -11,3 +11,7 @@ tests: net.vlan.header_reserved: extra_configs: - CONFIG_NET_L2_ETHERNET_RESERVE_HEADER=y + net.vlan.header_reserved.variable_size: + extra_configs: + - CONFIG_NET_L2_ETHERNET_RESERVE_HEADER=y + - CONFIG_NET_BUF_VARIABLE_DATA_SIZE=y