This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via 552fb4b8b5aa738959848dafc20d41e6fdbdbe4e (commit)
from 57d98918a1a11077d8d3e3caeaca9d85e4200ea5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 552fb4b8b5aa738959848dafc20d41e6fdbdbe4e
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date: Mon Feb 1 07:28:03 2016 +0100
dhcpcd: rework mtu handling on buggy nic's
some nic's loose the carrier after setting new mtu.
Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
config/dhcpc/dhcpcd-hooks/10-mtu | 31 ++++++++++++++++++++++++++++
config/rootfiles/core/98/filelists/files | 2 ++
lfs/dhcpcd | 4 ++--
src/initscripts/init.d/networking/dhcpcd.exe | 7 -------
4 files changed, 35 insertions(+), 9 deletions(-)
create mode 100644 config/dhcpc/dhcpcd-hooks/10-mtu
Difference in files:
diff --git a/config/dhcpc/dhcpcd-hooks/10-mtu b/config/dhcpc/dhcpcd-hooks/10-mtu
new file mode 100644
index 0000000..49e0519
--- /dev/null
+++ b/config/dhcpc/dhcpcd-hooks/10-mtu
@@ -0,0 +1,31 @@
+# Configure the MTU for the interface
+
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+
+set_mtu()
+{
+ local mtu=$1
+ ip link set "$interface" mtu "$mtu"
+
+ # test for buggy nic that lose link at mtu set...
+ carrier=`cat /sys/class/net/$interface/carrier`
+ if [ "$carrier" == "0" ]; then
+ syslog info "Warning! Carrier loss after MTU set. Reinit ..."
+ ip link set "$interface" down
+ ip link set "$interface" up
+ fi
+}
+if [ -n "$new_interface_mtu" ] && $if_up; then
+ if [ $RED_DHCP_FORCE_MTU -ge 576 ]; then
+ new_interface_mtu=$RED_DHCP_FORCE_MTU
+ fi
+ if [ ! "$new_interface_mtu" == "$ifmtu" ]; then
+ # The smalled MTU dhcpcd can work with is 576
+ if [ "$new_interface_mtu" -gt 576 ]; then
+ if set_mtu "$new_interface_mtu"; then
+ syslog info "MTU set to $new_interface_mtu"
+ fi
+ fi
+ fi
+fi
+
diff --git a/config/rootfiles/core/98/filelists/files b/config/rootfiles/core/98/filelists/files
index 8586e6a..ad5d9a7 100644
--- a/config/rootfiles/core/98/filelists/files
+++ b/config/rootfiles/core/98/filelists/files
@@ -1,6 +1,7 @@
etc/system-release
etc/issue
etc/rc.d/init.d/firewall
+etc/rc.d/init.d/networking/dhcpcd.exe
etc/modprobe.d/nf_conntrack.conf
srv/web/ipfire/cgi-bin/logs.cgi/firewalllog.dat
srv/web/ipfire/cgi-bin/logs.cgi/firewalllogcountry.dat
@@ -16,3 +17,4 @@ srv/web/ipfire/cgi-bin/webaccess.cgi
usr/bin/pgrep
usr/local/bin/qosctrl
usr/local/bin/timectrl
+var/ipfire/dhcpc/dhcpcd-hooks/10-mtu
diff --git a/lfs/dhcpcd b/lfs/dhcpcd
index ff31821..3b9a094 100644
--- a/lfs/dhcpcd
+++ b/lfs/dhcpcd
@@ -85,9 +85,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
rm -f $(CONFIG_ROOT)/dhcpc/dhcpcd-hooks/50-yp.conf
rm -f $(CONFIG_ROOT)/dhcpc/dhcpcd-hooks/50-ypbind
- sed -i -e "s|-ge 576|-gt 576|g" $(CONFIG_ROOT)/dhcpc/dhcpcd-hooks/10-mtu
-
install -m 644 $(DIR_SRC)/config/dhcpc/dhcpcd.conf $(CONFIG_ROOT)/dhcpc/
+ install -m 444 $(DIR_SRC)/config/dhcpc/dhcpcd-hooks/10-mtu $(CONFIG_ROOT)/dhcpc/dhcpcd-hooks
+
chown root:root $(CONFIG_ROOT)/dhcpc/dhcpcd.conf
@rm -rf $(DIR_APP)
diff --git a/src/initscripts/init.d/networking/dhcpcd.exe b/src/initscripts/init.d/networking/dhcpcd.exe
index a7bad47..a2cdc66 100644
--- a/src/initscripts/init.d/networking/dhcpcd.exe
+++ b/src/initscripts/init.d/networking/dhcpcd.exe
@@ -31,13 +31,6 @@ dhcpcd_up()
# Only if RED_TYPE=DHCP update /var/ipfire/red
if [ "$RED_TYPE" == "DHCP" ]; then
- #Force MTU option for KabelDeutschland because this ISP
- #set the MTU to 576 instead of the supportet 1500
- if [ $RED_DHCP_FORCE_MTU -ge 576 ]; then
- logger -p local0.info -t dhcpcd.exe[$$] "Force mtu to $RED_DHCP_FORCE_MTU"
- ip link set $interface mtu $RED_DHCP_FORCE_MTU
- fi
-
#Check if we have to restart the services at update
[ ! -e "/var/ipfire/red/active" ] && update=1;
if [ "$old_domain_name_service" != "$new_domain_name_service" ]; then
hooks/post-receive
--
IPFire 2.x development tree