A V  Vedanth created a merge request: 
https://gitlab.rtems.org/rtems/pkg/rtems-net-services/-/merge_requests/36

Project:Branches: av-vedanth/rtems-net-services:ntp-fix-parsing-state-reset to 
rtems/pkg/rtems-net-services:main
Author:   A V  Vedanth



## Summary

Changed scope of parsed and optct from inside parse_cmdline_opts() to global in 
ntpd.c .

Because parsed static local stays 1 even after first ntp run therefore skipping 
option processing on restart 

Created :

rtems_ntp_opts_globals_fini() to reset ntpdOptions runtime fields.

parsed and optct reset to 0 and rtems_ntp_opts_globals_fini() is called in 
rtems_ntpd_run() 

Verification test done on QEMU leon3 with `ntp01` test.

FIX : second NTP start no longer skips option processing

```
vedanth@vedanth-Legion-Pro-5-16IRX10:~/rtems_proj/rtems-net-services$ 
qemu-system-sparc -no-reboot -serial mon:stdio \
  -m 256M \
  -M leon3_generic \
  -kernel ~/rtems_proj/rtems-net-services/build/sparc-rtems7-leon3/ntp01.exe


*** BEGIN OF TEST NTP 1 ***
*** TEST VERSION: 7.0.0.108b17f882a298746228e878f50442684cac6a6e
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 15.2.0 20250808 (RTEMS 7, Build 2026.03.04, RSB 
00a71896204f95cb583e6271cad4c192b62cce6d, Newlib a7c61498)
nexus0: <RTEMS Nexus device>
info: lo0: link state changed to UP
info: version 6.2.1 starting
err: no valid interfaces found
warning: no interfaces have a carrier
info: telnetd: started successfully on port 23

RTEMS Shell on /dev/console. Use 'help' to list commands.
SHLL [/] # ntpd starting
ntpd forced stop
ntpd finished: 0
ntpd starting
```

## Generative AI

Used claude code and gemini to better understand the code base.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/pkg/rtems-net-services/-/merge_requests/36
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to