This issue also occurs if the netdev does not exist when dhcrelay
is started, but is hotplugged during the lifetime of the dhcrelay
process. In this case the Discarding packet …
error message does not appear.
For what it is worth, I am currently working around this issue by running the following script as a separate system service:
#! /bin/bash
while sleep 10; do
current=$(ip -4 -j address list | jq '.[].addr_info')
if ! diff -U 0 /proc/self/fd/10 /proc/self/fd/20 \
10<<<$previous 20<<<$current; then
echo IPv4 addresses changed, restarting dhcrelay.service
systemctl restart dhcrelay.service
fi
previous=$current
done