Skip to content

Commit

Permalink
ifup-routes: print warning when ADDRESS0 entry is missing
Browse files Browse the repository at this point in the history
When static routes are added via route-<interface> file, the ifup-routes
script will skip adding routes if entries not starting with ADDRESS0.

Good to print a warning so that users are aware of this.
  • Loading branch information
suresh2514 authored and mergify[bot] committed Feb 7, 2024
1 parent b751727 commit 72a4642
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions network-scripts/ifup-routes
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ MATCH='^[[:space:]]*(\#.*)?$'
handle_file () {
. $1
routenum=0

# print a warning if ADDRESS is not starting at ADDRESS0
if [ "x$(eval echo '$'ADDRESS$routenum)x" == "xx" ]; then
net_log $"Route entries are not sequentially ordered. Skipping $1 file" warning
exit 1
fi

while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do
eval $(ipcalc -p $(eval echo '$'ADDRESS$routenum) $(eval echo '$'NETMASK$routenum))
line="$(eval echo '$'ADDRESS$routenum)/$PREFIX"
Expand Down

0 comments on commit 72a4642

Please sign in to comment.