static executor: Ignore errors while removing addresses

When having multiple addresses set from the same prefix they might/will(?)
  be configured as 'secondary' and implicitly removed when removing the
  non-secondary address. This leads ip complaining about not being able
  to remove the secondaries as they are already gone. So we ignore errors
  while deconfiguring addresses as they liked occur when removing a
  vanish address anyway.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
Maximilian Wilhelm 2020-10-06 03:26:36 +02:00
parent 5302bee850
commit 5d6c7732ed

View file

@ -29,7 +29,16 @@ configure_addresses() {
PEER="" PEER=""
fi fi
${MOCK} ip "${addrfam}" addr "${1}" "${addr}" ${PEER} dev "${IFACE}" if [ -z "${MOCK}" -a "${1}" = "del" ]; then
# When having multiple addresses set from the same prefix they might/will(?) be configured
# as 'secondary' and implicitly removed when removing the non-secondary address. This
# leads ip complaining about not being able to remove the secondaries as they are already
# gone. So we ignore errors while deconfiguring addresses as they liked occur when removing
# a vanish address anyway.
${MOCK} ip "${addrfam}" addr "${1}" "${addr}" ${PEER} dev "${IFACE}" 2>/dev/null
else
${MOCK} ip "${addrfam}" addr "${1}" "${addr}" ${PEER} dev "${IFACE}"
fi
done done
} }