diff mbox

[OpenWrt-Devel] ramips: revert failsafe switch workaround for RT5350 introduced in r42179.

Message ID owrt-patches-20141225-4@vittgam.net
State Changes Requested
Delegated to: John Crispin
Headers show

Commit Message

Vittorio Gambaletta Dec. 25, 2014, 1:29 a.m. UTC
It is not needed anymore as TCP packets get passed correctly now even when VLAN is disabled.

This piece of code also broke routers where the LAN port is not wired to port 0 of the internal switch.

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>

Comments

John Crispin Jan. 17, 2015, 1:55 p.m. UTC | #1
On 25/12/2014 02:29, Vittorio G (VittGam) wrote:
> It is not needed anymore as TCP packets get passed correctly now
> even when VLAN is disabled.
> 

are you sure this is the case for all rt3x5x, rt5350 and mt7628 units ?


> This piece of code also broke routers where the LAN port is not
> wired to port 0 of the internal switch.
> 
> Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
> 
> diff --git
> a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
> b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
>
> 
index cae6396..386b527 100644
> ---
> a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
>
> 
+++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
> @@ -11,24 +11,7 @@ ramips_set_preinit_iface() { swconfig dev rt305x
> set reset 1 fi
> 
> -	if echo $RT3X5X | egrep -q "(RT5350|MT7628)"; then -		# This is a
> dirty hack to get by while the switch -		# problem is investigated.
> When VLAN is disabled, ICMP -		# pings work as expected, but TCP
> connections time -		# out, so telnetting in failsafe is impossible.
> The -		# likely reason is TCP checksumming hardware getting -		#
> disabled: -		#
> https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg19870.html
>
> 
-		swconfig dev rt305x set enable_vlan 1
> -		swconfig dev rt305x vlan 1 set ports "0 6" -		swconfig dev
> rt305x port 6 set untag 0 -		swconfig dev rt305x set apply 1 -
> vconfig add eth0 1 -		ifconfig eth0 up -		ifname=eth0.1 -	else -
> ifname=eth0 -	fi +	ifname=eth0 }
> 
> boot_hook_add preinit_main ramips_set_preinit_iface 
> _______________________________________________ openwrt-devel
> mailing list openwrt-devel@lists.openwrt.org 
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
Vittorio Gambaletta Jan. 17, 2015, 9:57 p.m. UTC | #2
Hi,

Il 17.01.2015 14:55 John Crispin ha scritto:
> On 25/12/2014 02:29, Vittorio G (VittGam) wrote:
>> It is not needed anymore as TCP packets get passed correctly now
>> even when VLAN is disabled.
>>
>
> are you sure this is the case for all rt3x5x, rt5350 and mt7628 units ?

I've tested it on my RT5350-based router. With a previous OpenWrt revision (r42649 if I remember well) it wasn't working, since it was zeroing a TCP field as seen from the tcpdump verbose output. I don't remember the tcpdump details correctly, sorry. But now with recent revisions it's working fine.

If you're not sure about this for rt3x5x and mt7628, it should at least get modified to "0 1 2 3 4 5 6" to avoid soft-bricking routers where the only Ethernet port exposed is not 0 (4 for the HT-TM02 for instance).

Cheers,
Vittorio
diff mbox

Patch

diff --git a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
index cae6396..386b527 100644
--- a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
+++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
@@ -11,24 +11,7 @@  ramips_set_preinit_iface() {
 		swconfig dev rt305x set reset 1
 	fi
 
-	if echo $RT3X5X | egrep -q "(RT5350|MT7628)"; then
-		# This is a dirty hack to get by while the switch
-		# problem is investigated. When VLAN is disabled, ICMP
-		# pings work as expected, but TCP connections time
-		# out, so telnetting in failsafe is impossible. The
-		# likely reason is TCP checksumming hardware getting
-		# disabled:
-		# https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg19870.html
-		swconfig dev rt305x set enable_vlan 1
-		swconfig dev rt305x vlan 1 set ports "0 6"
-		swconfig dev rt305x port 6 set untag 0
-		swconfig dev rt305x set apply 1
-		vconfig add eth0 1
-		ifconfig eth0 up
-		ifname=eth0.1
-	else
-		ifname=eth0
-	fi
+	ifname=eth0
 }
 
 boot_hook_add preinit_main ramips_set_preinit_iface