git: if_loop: Clean up if_simloop() a bit

Aaron LI aly at crater.dragonflybsd.org
Sun Oct 11 07:02:28 PDT 2026


commit 332de8a41f94fdbdad0fd58859214dfc9bcc17db
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Oct 11 13:26:34 2026 +0800

    if_loop: Clean up if_simloop() a bit
    
    * Use M_ASSERTPKTHDR() avoid an ad-hoc KASSERT().
    * Use 'uint32_t' instead of plain 'int' to handle the BPF header.
    * Use m_adj() to strip the BPF header.
    * Replace the KASSERT() with a kprintf() warning if the BPF-injected
      packet is too short.

Summary of changes:
 sys/net/if_loop.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/332de8a41f94fdbdad0fd58859214dfc9bcc17db


-- 
DragonFly BSD source repository


More information about the Commits mailing list