Skip to content

Commit

Permalink
pf_cmina: Fix ARP response after factory reset
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Philip Vedin committed Feb 22, 2024
1 parent 2f0e146 commit b0c7210
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/device/pf_cmina.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0c7210

Please sign in to comment.