"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "elements/amphora-agent/static/usr/local/bin/udp-masquerade.sh" between
octavia-7.1.1.tar.gz and octavia-8.0.0.tar.gz

About: OpenStack Octavia is an operator-grade reference implementation for Load Balancing as a Service (LBaaS).
The "Wallaby" series (latest release).

udp-masquerade.sh  (octavia-7.1.1):udp-masquerade.sh  (octavia-8.0.0)
skipping to change at line 39 skipping to change at line 39
fi fi
if [ "$1" == "add" ]; then if [ "$1" == "add" ]; then
if [ -x "$(sudo bash -c 'command -v nft')" ]; then if [ -x "$(sudo bash -c 'command -v nft')" ]; then
# Note: inet for nat requires a 5.2 or newer kernel. # Note: inet for nat requires a 5.2 or newer kernel.
if [ "$2" == "ipv4" ]; then if [ "$2" == "ipv4" ]; then
nft add table ip octavia-ipv4 nft add table ip octavia-ipv4
nft add chain ip octavia-ipv4 ip-udp-masq { type nat hook postroutin g priority 100\;} nft add chain ip octavia-ipv4 ip-udp-masq { type nat hook postroutin g priority 100\;}
nft add rule ip octavia-ipv4 ip-udp-masq oifname "$3" meta l4proto u dp masquerade nft add rule ip octavia-ipv4 ip-udp-masq oifname "$3" meta l4proto u dp masquerade
nft add chain ip octavia-ipv4 ip-sctp-masq { type nat hook postrouti
ng priority 100\;}
nft add rule ip octavia-ipv4 ip-sctp-masq oifname "$3" meta l4proto
sctp masquerade
elif [ "$2" == "ipv6" ]; then elif [ "$2" == "ipv6" ]; then
nft add table ip6 octavia-ipv6 nft add table ip6 octavia-ipv6
nft add chain ip6 octavia-ipv6 ip6-udp-masq { type nat hook postrout ing priority 100\;} nft add chain ip6 octavia-ipv6 ip6-udp-masq { type nat hook postrout ing priority 100\;}
nft add rule ip6 octavia-ipv6 ip6-udp-masq oifname "$3" meta l4proto udp masquerade nft add rule ip6 octavia-ipv6 ip6-udp-masq oifname "$3" meta l4proto udp masquerade
nft add chain ip6 octavia-ipv6 ip6-sctp-masq { type nat hook postrou
ting priority 100\;}
nft add rule ip6 octavia-ipv6 ip6-sctp-masq oifname "$3" meta l4prot
o sctp masquerade
else else
usage usage
fi fi
else # nft not found, fall back to iptables else # nft not found, fall back to iptables
if [ "$2" == "ipv4" ]; then if [ "$2" == "ipv4" ]; then
/sbin/iptables -t nat -A POSTROUTING -p udp -o $3 -j MASQUERADE /sbin/iptables -t nat -A POSTROUTING -p udp -o $3 -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -p sctp -o $3 -j MASQUERADE
elif [ "$2" == "ipv6" ]; then elif [ "$2" == "ipv6" ]; then
/sbin/ip6tables -t nat -A POSTROUTING -p udp -o $3 -j MASQUERADE /sbin/ip6tables -t nat -A POSTROUTING -p udp -o $3 -j MASQUERADE
/sbin/ip6tables -t nat -A POSTROUTING -p sctp -o $3 -j MASQUERADE
else else
usage usage
fi fi
fi fi
elif [ "$1" == "delete" ]; then elif [ "$1" == "delete" ]; then
if [ -x "$(sudo bash -c 'command -v nft')" ]; then if [ -x "$(sudo bash -c 'command -v nft')" ]; then
if [ "$2" == "ipv4" ]; then if [ "$2" == "ipv4" ]; then
nft flush chain ip octavia-ipv4 ip-udp-masq nft flush chain ip octavia-ipv4 ip-udp-masq
nft delete chain ip octavia-ipv4 ip-udp-masq nft delete chain ip octavia-ipv4 ip-udp-masq
nft flush chain ip octavia-ipv4 ip-sctp-masq
nft delete chain ip octavia-ipv4 ip-sctp-masq
elif [ "$2" == "ipv6" ]; then elif [ "$2" == "ipv6" ]; then
nft flush chain ip6 octavia-ipv6 ip-udp-masq nft flush chain ip6 octavia-ipv6 ip-udp-masq
nft delete chain ip6 octavia-ipv6 ip-udp-masq nft delete chain ip6 octavia-ipv6 ip-udp-masq
nft flush chain ip6 octavia-ipv6 ip-sctp-masq
nft delete chain ip6 octavia-ipv6 ip-sctp-masq
else else
usage usage
fi fi
else # nft not found, fall back to iptables else # nft not found, fall back to iptables
if [ "$2" == "ipv4" ]; then if [ "$2" == "ipv4" ]; then
/sbin/iptables -t nat -D POSTROUTING -p udp -o $3 -j MASQUERADE /sbin/iptables -t nat -D POSTROUTING -p udp -o $3 -j MASQUERADE
/sbin/iptables -t nat -D POSTROUTING -p sctp -o $3 -j MASQUERADE
elif [ "$2" == "ipv6" ]; then elif [ "$2" == "ipv6" ]; then
/sbin/ip6tables -t nat -D POSTROUTING -p udp -o $3 -j MASQUERADE /sbin/ip6tables -t nat -D POSTROUTING -p udp -o $3 -j MASQUERADE
/sbin/ip6tables -t nat -D POSTROUTING -p sctp -o $3 -j MASQUERADE
else else
usage usage
fi fi
fi fi
else else
usage usage
fi fi
 End of changes. 8 change blocks. 
0 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)