git: if_clone: Refactor cloner lookup and unit extraction

Aaron LI aly at crater.dragonflybsd.org
Sat Aug 4 20:59:17 PDT 2018


commit 2010725f220e9d634a6a5904b38db67627cb3a80
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Aug 4 20:06:21 2018 +0800

    if_clone: Refactor cloner lookup and unit extraction
    
    Break down the old 'if_clone_lookup()' function into the following 3
    functions:
    
    - if_name2unit(): extract the unit number from the interface name.
      Obtained from FreeBSD and has fixes (disallow leading zeros; avoid
      unit overflow).
    
    - if_clone_match(): check whether the cloner matches the interface name.
    
    - new if_clone_lookup(): only lookup the cloner for the interface name.

Summary of changes:
 sys/net/if_clone.c | 105 +++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 73 insertions(+), 32 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2010725f220e9d634a6a5904b38db67627cb3a80


-- 
DragonFly BSD source repository


More information about the Commits mailing list