#1033651 ifupdown: "ifdown -a" brings the interfaces down in the reverse order while the man page claims the opposite

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
Martin Tonusoo
Date:
2023-03-29 11:03:05 UTC
Severity:
normal
#1033651#5
Date:
2023-03-29 11:02:16 UTC
From:
To:
The man page of ifup(8) under "--all" option claims that "Interfaces are brought down in the order in which they are currently listed in the state file". However, the "for" loop seen below in read_all_state() function in main.c reverses the order of interfaces listed in the state file in case of "ifdown -a" or "ifquery --state":

        for (int i = 0; i < ((*n_ifaces) / 2); i++) {
                char *temp = (*ifaces)[i];

                (*ifaces)[i] = (*ifaces)[(*n_ifaces) - i - 1];
                (*ifaces)[(*n_ifaces) - i - 1] = temp;
        }

Perhaps the man page if ifup(8) could be updated? For example:

"Interfaces are brought down in the reversed order in which they
are currently listed in the state file."

..or:

"Interfaces are brought down in the order in which they
are listed in the output of 'ifquery --state'."

I am using Debian GNU/Linux 10, kernel 4.19.0-23-amd64 and libc6 ver 2.28-10+deb10u2.