• Miek Gieben's avatar
    plugin/host: don't append the names when reparsing hosts file (#3045) · 89fa9bc6
    Miek Gieben authored
    The host plugin kept on adding entries instead of overwriting. Split the
    inline cache off from the /etc/hosts file cache and clear /etc/hosts
    file cache and re-parsing.
    
    A bunch of other cleanup as well. Use functions defined in the plugin
    package, don't re-parse strings if you don't have to and use To4() to
    check the family for IP addresses. Fix all test cases a carried entries
    are always fqdn-ed. Various smaller cleanup in unnessacry constants.
    
    Fixes: #3014
    Signed-off-by: default avatarMiek Gieben <miek@miek.nl>
    89fa9bc6
setup_test.go 4.08 KB