# The smalled MTU dhcpcd can work with is 576
if [ "$new_interface_mtu" -ge 576 ]; then
if ifconfig "$interface" mtu "$new_interface_mtu"; then
+ syslog info "$interface: MTU set to $new_interface_mtu"
# Save the MTU so we can restore it later
if [ ! -e "$mtu_dir/$interface" ]; then
mkdir -p "$mtu_dir"
fi
elif [ -e "$mtu_dir/$interface" ]; then
# No MTU in this state, so restore the prior MTU
- ifconfig "$interface" mtu $(cat "$mtu_dir/$interface")
+ mtu=$(cat "$mtu_dir/$interface")
+ syslog info "$interface: MTU restored to $mtu"
+ ifconfig "$interface" mtu "$mtu"
rm "$mtu_dir/$interface"
fi
rm -f "$1-pre.$interface"
}
+# Write a syslog entry
+syslog()
+{
+ local lvl="$1"
+
+ [ -n "$lvl" ] && shift
+ if [ -n "$@" ]; then
+ if type logger >/dev/null 2>&1; then
+ logger -t dhcpcd -p daemon."$lvl" -s "$@"
+ fi
+ fi
+}
+
# We source each script into this one so that scripts run earlier can
# remove variables from the environment so later scripts don't see them.