Skip to content

Commit

Permalink
[test_dhcpv6_relay]: set DHCP server MAC address for packets send fro…
Browse files Browse the repository at this point in the history
…m server's name (#4177)

Summary: fixed test_dhcpv6_relay - set src MAC address for DHCP reply packets

fixed DHCP server forged packets
Reply packets sent from DHCP server's name don't have MACs set and they don't come to DHCP client. Added src MACs for the packets and the packets now come to the client
  • Loading branch information
antonptashnik authored Sep 14, 2021
1 parent 22e48b2 commit 171df86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ansible/roles/test/files/ptftests/dhcpv6_relay_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def verify_relayed_solicit_relay_forward(self):
def server_send_advertise_relay_reply(self):
# Form and send DHCPv6 RELAY-REPLY encapsulating ADVERTISE packet
advertise_relay_reply_packet = self.create_dhcp_advertise_relay_reply_packet()
advertise_relay_reply_packet.src = self.dataplane.get_mac(0, self.server_port_indices[0])
testutils.send_packet(self, self.server_port_indices[0], advertise_relay_reply_packet)

# Verify that the DHCPv6 ADVERTISE would be received by our simulated client
Expand Down Expand Up @@ -279,6 +280,7 @@ def verify_relayed_request_relay_forward(self):
def server_send_reply_relay_reply(self):
# Form and send DHCPv6 RELAY-REPLY encapsulating REPLY packet
reply_relay_reply_packet = self.create_dhcp_reply_relay_reply_packet()
reply_relay_reply_packet.src = self.dataplane.get_mac(0, self.server_port_indices[0])
testutils.send_packet(self, self.server_port_indices[0], reply_relay_reply_packet)

# Verify that the DHCPv6 REPLY would be received by our simulated client
Expand Down

0 comments on commit 171df86

Please sign in to comment.