summaryrefslogtreecommitdiff
path: root/templates/firewall/ip-src-route/node.def
blob: 5fa3b19364fdb9a2d4d97c215417754f2c945c6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# accept_source_route 
# default - 0 
# Accept packets with SRR option. conf/all/accept_source_route and 
# conf/[interface]/accept_source_route must be set to TRUE 
# to accept packets with SRR option on the interface 

type: txt

help: Policy for handling IPv4 packets with source route option

val_help: enable; Enable processing of IPv4 packets with source route option
val_help: disable; Disable processing of IPv4 packets with source route option

default: "disable"

syntax:expression: $VAR(@) in "enable", "disable"; "ip-src-route must be enable or disable"

update:
	if [ x$VAR(@) == xenable ]; then
            array=(`ls /proc/sys/net/ipv4/conf/`)
            array_len=${#array[*]}
            i=0
            while [ $i -lt $array_len ]; do
               sudo sh -c "echo 1 > \
                 /proc/sys/net/ipv4/conf/${array[$i]%:*}/accept_source_route"
               let i++
            done
        else
	    sudo sh -c "echo 0 > \
		/proc/sys/net/ipv4/conf/all/accept_source_route"
	fi

delete:
	sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route"