Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/setup-policy-routes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ case "$2" in
refresh)
register_networkd_reloader
[ -e "/sys/class/net/${iface}" ] || exit 0
info "Starting configuration refresh for $iface"
debug "Starting configuration refresh for $iface"
do_setup
;;
start)
Expand All @@ -57,15 +57,15 @@ start)
sleep 0.1
((counter++))
done
info "Starting configuration for $iface"
debug "Starting configuration for $iface"
debug /lib/systemd/systemd-networkd-wait-online -i "$iface"
/lib/systemd/systemd-networkd-wait-online -i "$iface"
export EC2_IF_INITIAL_SETUP=1
do_setup
;;
remove)
register_networkd_reloader
info "Removing configuration for $iface."
debug "Removing configuration for $iface."
rm -rf "/run/network/$iface" \
"${unitdir}/70-${iface}.network" \
"${unitdir}/70-${iface}.network.d" || true
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
amazon-ec2-net-utils (2.7.2) unstable; urgency=medium

* New upstream release 2.7.2

-- Joe Kurokawa <joekurok@amazon.com> Tue, 24 Mar 2026 09:15:00 +0000

amazon-ec2-net-utils (2.7.1) unstable; urgency=medium

* New upstream release 2.7.1
Expand Down
10 changes: 5 additions & 5 deletions debian/patches/update-networkd-priorities.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ ensure they're order before netplan
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/setup-policy-routes.sh b/bin/setup-policy-routes.sh
index e4c67d8..a8b9fc8 100755
index 7c51089..335ce18 100755
--- a/bin/setup-policy-routes.sh
+++ b/bin/setup-policy-routes.sh
@@ -63,8 +63,8 @@ remove)
@@ -67,8 +67,8 @@ remove)
register_networkd_reloader
info "Removing configuration for $iface."
debug "Removing configuration for $iface."
rm -rf "/run/network/$iface" \
- "${unitdir}/70-${iface}.network" \
- "${unitdir}/70-${iface}.network.d" || true
Expand All @@ -25,7 +25,7 @@ index e4c67d8..a8b9fc8 100755
;;
stop|cleanup)
diff --git a/lib/lib.sh b/lib/lib.sh
index bb1241a..1d103c8 100644
index fb1f2a8..8cbb1e8 100644
--- a/lib/lib.sh
+++ b/lib/lib.sh
@@ -236,7 +236,7 @@ create_ipv4_aliases() {
Expand Down Expand Up @@ -54,7 +54,7 @@ index bb1241a..1d103c8 100644
+ local cfgfile="${unitdir}/07-${iface}.network"
if [ -e "$cfgfile" ] &&
[ ! -v EC2_IF_INITIAL_SETUP ]; then
debug "Using existing cfgfile ${cfgfile}"
echo $retval
--
2.47.3

13 changes: 6 additions & 7 deletions lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ get_meta() {
local key=$1
local max_tries=${2:-10}
declare -i attempts=0
debug "[get_meta] Querying IMDS for ${key}"
[ -v EC2_IF_INITIAL_SETUP ] && debug "[get_meta] Querying IMDS for ${key}"

if [[ -z $imds_endpoint || -z $imds_token || -z $imds_interface ]]; then
error "[get_meta] Unable to obtain IMDS token, endpoint, or interface"
Expand Down Expand Up @@ -326,7 +326,7 @@ create_rules() {
# response.
addrs=$(get_iface_imds ${ether} ${local_addr_key} || true)
if [[ -z "$addrs" ]]; then
info "No addresses found for ${ether}"
debug "No addresses found for ${ether}"
return 0
fi

Expand Down Expand Up @@ -466,7 +466,6 @@ create_interface_config() {
local cfgfile="${unitdir}/70-${iface}.network"
if [ -e "$cfgfile" ] &&
[ ! -v EC2_IF_INITIAL_SETUP ]; then
debug "Using existing cfgfile ${cfgfile}"
echo $retval
return
fi
Expand Down Expand Up @@ -616,9 +615,9 @@ maybe_reload_networkd() {
if [ -e "$reload_flag" ]; then
rm -f "$reload_flag" 2> /dev/null
networkctl reload
info "Reloaded networkd"
debug "Reloaded networkd"
else
debug "No networkd reload needed"
[ -v EC2_IF_INITIAL_SETUP ] && debug "No networkd reload needed"
fi
else
debug "Deferring networkd reload to another process"
Expand All @@ -639,7 +638,7 @@ register_networkd_reloader() {
while [ $cnt -lt $max ]; do
cnt+=1
mkdir -p "$lockdir"
trap 'debug "Called trap" ; maybe_reload_networkd' EXIT
trap '[ -v EC2_IF_INITIAL_SETUP ] && debug "Called trap" ; maybe_reload_networkd' EXIT
# If the redirect fails, most likely because the target file
# already exists and -o noclobber is in effect, $? will be set
# nonzero. If it succeeds, it is set to 0
Expand All @@ -649,7 +648,7 @@ register_networkd_reloader() {
[ $registered -eq 0 ] && break
sleep 0.1
if (( $cnt % 100 == 0 )); then
info "Unable to lock ${iface} after ${cnt} tries."
debug "Unable to lock ${iface} after ${cnt} tries."
fi
done
# re-enable -o errexit if it had originally been set
Expand Down
Loading