From c27c987075417a7d197bd74f80d7d97a3b79d421 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 21 Jun 2022 12:23:07 -0400 Subject: [PATCH] freebsd_network: Fix address restriction computation in bus_dma. The min/max usage was reversd from what it should be. This would have led to the least restrictive restrictions being the ones that were checked, instead of the most restrictive. --- src/libs/compat/freebsd_network/bus_dma.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/compat/freebsd_network/bus_dma.cpp b/src/libs/compat/freebsd_network/bus_dma.cpp index 34f39d0da0..0aedf9b4cc 100644 --- a/src/libs/compat/freebsd_network/bus_dma.cpp +++ b/src/libs/compat/freebsd_network/bus_dma.cpp @@ -125,9 +125,9 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, bus_addr_t bounda newtag->parent = parent; atomic_add(&parent->ref_count, 1); - newtag->lowaddr = max_c(parent->lowaddr, newtag->lowaddr); - newtag->highaddr = min_c(parent->highaddr, newtag->highaddr); - newtag->alignment = max_c(parent->alignment, newtag->alignment); + newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); + newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); + newtag->alignment = MAX(parent->alignment, newtag->alignment); if (newtag->boundary == 0) { newtag->boundary = parent->boundary;