Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encap src_ip is not required for the IPinIP decap tunnels #2162

Merged
merged 2 commits into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions dockers/docker-orchagent/ipinip.json.j2
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{% set ipv4_addresses = [] %}
{% set ipv6_addresses = [] %}
{% set ipv4_loopback_addresses = [] %}
{% set ipv6_loopback_addresses = [] %}
{% for (name, prefix) in LOOPBACK_INTERFACE %}
{%- if prefix | ipv4 and name == 'Loopback0' %}
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
{%- set ipv4_loopback_addresses = ipv4_loopback_addresses.append(prefix) %}
{%- endif %}
{%- if prefix | ipv6 and name == 'Loopback0' %}
{%- set ipv6_addresses = ipv6_addresses.append(prefix) %}
{%- set ipv6_loopback_addresses = ipv6_loopback_addresses.append(prefix) %}
{%- endif %}
{% endfor %}
{% for (name, prefix) in INTERFACE %}
Expand Down Expand Up @@ -37,11 +33,10 @@
{%- endif %}
{% endfor %}
[
{% if ipv4_loopback_addresses %}
{% if ipv4_addresses %}
{
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP",
"src_ip":"{{ ipv4_loopback_addresses | first | ip }}",
prsunny marked this conversation as resolved.
Show resolved Hide resolved
"dst_ip":"{% for prefix in ipv4_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
{% if "mlnx" in DEVICE_METADATA.localhost.platform %}
"dscp_mode":"uniform",
Expand All @@ -55,13 +50,12 @@
"OP": "SET"
}
{% endif %}
{% if ipv4_loopback_addresses and ipv6_loopback_addresses %} ,
{% if ipv4_addresses and ipv6_addresses %} ,
{% endif %}
{% if ipv6_loopback_addresses %}
{% if ipv6_addresses %}
{
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {
"tunnel_type":"IPINIP",
"src_ip":"{{ ipv6_loopback_addresses | first | ip }}",
"dst_ip":"{% for prefix in ipv6_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
{% if "mlnx" in DEVICE_METADATA.localhost.platform %}
"dscp_mode":"uniform",
Expand Down
2 changes: 0 additions & 2 deletions src/sonic-config-engine/tests/sample_output/ipinip.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP",
"src_ip":"10.1.0.32",
"dst_ip":"10.1.0.32,10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,192.168.0.1",
"dscp_mode":"pipe",
"ecn_mode":"copy_from_outer",
Expand All @@ -14,7 +13,6 @@
{
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {
"tunnel_type":"IPINIP",
"src_ip":"fc00:1::32",
"dst_ip":"fc00:1::32,fc00::71,fc00::75,fc00::79,fc00::7d",
"dscp_mode":"pipe",
"ecn_mode":"copy_from_outer",
Expand Down