aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-06-10 11:26:07 +0000
committerPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-06-12 16:18:28 +0000
commit9f80c8b90bdaa8ffac887a8c478a16c84d74a87b (patch)
treefd77b0d33055c74a6235783a0257c0797f97737b /libexec
parent75b23c102e8d797654025affdfada0b6771a95ba (diff)
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/rc/rc.d/routing19
1 files changed, 16 insertions, 3 deletions
diff --git a/libexec/rc/rc.d/routing b/libexec/rc/rc.d/routing
index dd75604125a3..93e41c41a52b 100755
--- a/libexec/rc/rc.d/routing
+++ b/libexec/rc/rc.d/routing
@@ -190,7 +190,13 @@ static_inet()
if [ $_skip = 0 ]; then
route_args=`get_if_var ${i%:*} route_IF`
if [ -n "$route_args" ]; then
- ${ROUTE_CMD} ${_action} ${route_args}
+ # Loopback routes may already be added by the kernel; ignore EEXIST.
+ if [ "${i%:*}" = "_loopback" ]; then
+ ${ROUTE_CMD} ${_action} ${route_args} 2>&1 >/dev/null |
+ sed -e '/route: message indicates error: File exists/d' >&2
+ else
+ ${ROUTE_CMD} ${_action} ${route_args}
+ fi
else
warn "route_${i%:*} not found."
fi
@@ -267,8 +273,15 @@ static_inet6()
if [ $_skip = 0 ]; then
ipv6_route_args=`get_if_var ${i%:*} ipv6_route_IF`
if [ -n "$ipv6_route_args" ]; then
- ${ROUTE_CMD} ${_action} \
- -inet6 ${ipv6_route_args}
+ # Loopback routes may already be added by the kernel; ignore EEXIST.
+ if [ "${i%:*}" = "_loopback" ]; then
+ ${ROUTE_CMD} ${_action} -inet6 \
+ ${ipv6_route_args} 2>&1 >/dev/null |
+ sed -e '/route: message indicates error: File exists/d' >&2
+ else
+ ${ROUTE_CMD} ${_action} \
+ -inet6 ${ipv6_route_args}
+ fi
else
warn "route_${i%:*} not found"
fi