#1040340 ifupdown: return should be exit in /etc/network/if-up.d/resolved

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
Jeroen Coekaerts
Date:
2023-07-04 15:39:08 UTC
Severity:
normal
#1040340#5
Date:
2023-07-04 15:28:06 UTC
From:
To:
When I try to add an extra IP to the loopback address with a second
"iface lo" entry in a file in /etc/network/interfaces.d/ I get an error:

 ifup[574]: /etc/network/if-up.d/resolved: line 18: return: can only `return' from a function or sourced script
 ifup[570]: run-parts: /etc/network/if-up.d/resolved exited with return code 2

and the extra address is not added
If i change the return in
    if [ "$interface" = "lo" ]; then
        return
    fi
to an "exit" like a few lines higher, the error is gone and the extra ip
is added

(when systemd-resolved is enabled)