OLD | NEW |
| (Empty) |
1 # Configure the MTU for the interface | |
2 | |
3 mtu_dir="$state_dir/mtu" | |
4 | |
5 if [ "$reason" = PREINIT -a -e "$mtu_dir/$interface" ]; then | |
6 rm "$mtu_dir/$interface" | |
7 elif [ "$reason" != TEST -a -n "$new_interface_mtu" ]; then | |
8 # The smalled MTU dhcpcd can work with is 576 | |
9 if [ "$new_interface_mtu" -ge 576 ]; then | |
10 if ifconfig "$interface" mtu "$new_interface_mtu"; then | |
11 syslog info "$interface: MTU set to $new_interface_mtu" | |
12 # Save the MTU so we can restore it later | |
13 if [ ! -e "$mtu_dir/$interface" ]; then | |
14 mkdir -p "$mtu_dir" | |
15 echo "$ifmtu" > "$mtu_dir/$interface" | |
16 fi | |
17 fi | |
18 fi | |
19 elif [ "$reason" != TEST -a -e "$mtu_dir/$interface" ]; then | |
20 # No MTU in this state, so restore the prior MTU | |
21 mtu=$(cat "$mtu_dir/$interface") | |
22 syslog info "$interface: MTU restored to $mtu" | |
23 ifconfig "$interface" mtu "$mtu" | |
24 rm "$mtu_dir/$interface" | |
25 fi | |
OLD | NEW |