#!/bin/sh /etc/rc.common

START=10

boot() {
	#1
	brctl addbr inf
	brctl addif inf eth0
	brctl addif inf eth1
	ifconfig eth0 up
	ifconfig eth1 up
	local inf_mac=$(uci get network.lan.macaddr)
	ifconfig inf hw ether "${inf_mac}"
	ifconfig inf up
	
	vlan_filter=$(uci -c /etc/profile.d get profile.@switch_info[0].vlan_filter)
	if [ "$vlan_filter" == "1" ]; then
		ip link set inf type bridge vlan_filtering 1
	fi
	
	bridge vlan del dev eth0 vid 1
	bridge vlan del dev eth1 vid 1
        
        #Solve the problem that igmp snooping causes report packet loss
	echo 0 > /sys/devices/virtual/net/inf/bridge/multicast_snooping
	#fix bug 722261 Enable the ignore_routes_with_linkdown switch to disable linkdown routes
	#Note If the phy port is changed, the corresponding NIC parameters must be modified
	echo 1 > /proc/sys/net/ipv4/conf/default/ignore_routes_with_linkdown
	echo 1 > /proc/sys/net/ipv4/conf/eth1/ignore_routes_with_linkdown
	echo 1 > /proc/sys/net/ipv6/conf/default/ignore_routes_with_linkdown
    echo 1 > /proc/sys/net/ipv6/conf/eth1/ignore_routes_with_linkdown
}
