From b0c72101ee1a321fa3d0e50a263e7afdc55c3c19 Mon Sep 17 00:00:00 2001 From: Philip Vedin Date: Thu, 22 Feb 2024 13:26:43 +0100 Subject: [PATCH] pf_cmina: Fix ARP response after factory reset Automated RT-Tester: DCP_ResetToFactory (v2.44) When performing a Reset Communication Parameter factory reset, the IP suite is zeroed. However, this was only done to p-net's non-volatile storage. Thus, p-net would respond to ARP requests destined to the old IP address until the IP address is changed or after a reset. This commit also resets the network interface. --- src/device/pf_cmina.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/device/pf_cmina.c b/src/device/pf_cmina.c index b287a4b99..2b78bdfa4 100644 --- a/src/device/pf_cmina.c +++ b/src/device/pf_cmina.c @@ -318,6 +318,15 @@ int pf_cmina_set_default_cfg (pnet_t * net, uint16_t reset_mode) 0, sizeof (net->cmina_nonvolatile_dcp_ase.station_name)); + /* Reset network interface */ + pnal_set_ip_suite ( + net->pf_interface.main_port.name, + &net->cmina_nonvolatile_dcp_ase.full_ip_suite.ip_suite.ip_addr, + &net->cmina_nonvolatile_dcp_ase.full_ip_suite.ip_suite.ip_mask, + &net->cmina_nonvolatile_dcp_ase.full_ip_suite.ip_suite.ip_gateway, + net->cmina_nonvolatile_dcp_ase.station_name, + true) + pf_file_clear (p_file_directory, PF_FILENAME_IP); pf_file_clear (p_file_directory, PF_FILENAME_DIAGNOSTICS); #if PNET_OPTION_SNMP