Skip to content

Commit

Permalink
Revert "Add alternative DHCP relay for L3 interfaces"
Browse files Browse the repository at this point in the history
This reverts commit 05514f9.
  • Loading branch information
lukasstockner committed Aug 1, 2023
1 parent 8064cb2 commit 38d0ab0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 49 deletions.
6 changes: 3 additions & 3 deletions dockers/docker-dhcp-relay/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ ENV DEBIAN_FRONTEND=noninteractive
# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

# Update apt's cache of available packages and install dhcp-helper
RUN apt-get update && apt-get install -y dhcp-helper
# Update apt's cache of available packages
RUN apt-get update

{% if docker_dhcp_relay_debs.strip() -%}
# Copy built Debian packages
Expand All @@ -26,7 +26,7 @@ RUN apt-get update && apt-get install -y dhcp-helper

COPY ["docker_init.sh", "start.sh", "/usr/bin/"]
COPY ["docker-dhcp-relay.supervisord.conf.j2", "port-name-alias-map.txt.j2", "wait_for_intf.sh.j2", "/usr/share/sonic/templates/"]
COPY ["dhcp-relay.programs.j2", "dhcpv4-relay.agents.j2", "dhcpv4-interface-relay.agents.j2", "dhcpv6-relay.agents.j2", "dhcp-relay.monitors.j2", "/usr/share/sonic/templates/"]
COPY ["dhcp-relay.programs.j2", "dhcpv4-relay.agents.j2", "dhcpv6-relay.agents.j2", "dhcp-relay.monitors.j2", "/usr/share/sonic/templates/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]
COPY ["cli", "/cli/"]
Expand Down
6 changes: 0 additions & 6 deletions dockers/docker-dhcp-relay/dhcp-relay.programs.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,3 @@ isc-dhcpv4-relay-{{ vlan_name }}
{% set _dummy = add_preceding_comma.update({'flag': True}) %}
dhcp6relay
{% endif %}
{# Append interface DHCPv4 agents #}
{% for interface_relay in interface_relays %}
{% if add_preceding_comma.flag %},{% endif %}
{% set _dummy = add_preceding_comma.update({'flag': True}) %}
interface-dhcpv4-relay-{{ loop.index }}
{% endfor %}
15 changes: 0 additions & 15 deletions dockers/docker-dhcp-relay/dhcpv4-interface-relay.agents.j2

This file was deleted.

21 changes: 5 additions & 16 deletions dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running

{# If our configuration has VLANs... #}
{% if VLAN_INTERFACE %}
{# Count how many VLANs require a DHCP relay agent... #}
{% set ipv4_num_relays = { 'count': 0 } %}
{% set ipv6_num_relays = { 'count': 0 } %}
{% set interface_relays = dict() %}
{# If our configuration has VLANs... #}
{% if VLAN_INTERFACE %}
{% for vlan_name in VLAN_INTERFACE %}
{% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %}
{% set _dummy = ipv4_num_relays.update({'count': ipv4_num_relays.count + 1}) %}
Expand All @@ -53,18 +52,8 @@ dependent_startup_wait_for=rsyslogd:running
{% set _dummy = ipv6_num_relays.update({'count': ipv6_num_relays.count + 1}) %}
{% endif %}
{% endfor %}
{% endif %}
{% if INTERFACE %}
{% for iface_name, iface_data in INTERFACE.items() %}
{% if 'dhcp_servers' in iface_data and iface_data['dhcp_servers']|length > 0 %}
{# Group interfaces by identical server list #}
{% set key = ().__class__(iface_data['dhcp_servers']) %}
{% set _dummy = interface_relays.update({key: [iface_name] if key not in interface_relays else interface_relays[key] + [iface_name]}) %}
{% endif %}
{% endfor %}
{% endif %}
{# If one or more DHCP relay agent is required... #}
{% if ipv4_num_relays.count > 0 or ipv6_num_relays.count > 0 or interface_relays|length > 0 %}
{# If one or more of the VLANs require a DHCP relay agent... #}
{% if ipv4_num_relays.count > 0 or ipv6_num_relays.count > 0 %}
{% include 'dhcp-relay.programs.j2' %}


Expand All @@ -76,6 +65,6 @@ dependent_startup_wait_for=rsyslogd:running
{% endfor %}

{% include 'dhcpv6-relay.agents.j2' %}
{% include 'dhcpv4-interface-relay.agents.j2' %}
{% include 'dhcp-relay.monitors.j2' %}
{% endif %}
{% endif %}
9 changes: 0 additions & 9 deletions src/sonic-yang-models/yang-models/sonic-interface.yang
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ module sonic-interface {
namespace "http://github.com/Azure/sonic-interface";
prefix intf;

import ietf-inet-types {
prefix inet;
}

import sonic-types {
prefix stypes;
}
Expand Down Expand Up @@ -83,11 +79,6 @@ module sonic-interface {
description "Packet action when a packet ingress and gets routed on the same IP interface";
type stypes:loopback_action;
}

leaf-list dhcp_servers {
description "Configure the dhcp v4 servers";
type inet:ip-address;
}
}
/* end of INTERFACE_LIST */

Expand Down

0 comments on commit 38d0ab0

Please sign in to comment.