Skip to content

A bunch of small LLM-assisted fixes - #1049

Draft
stv0g wants to merge 43 commits into
masterfrom
llm-fixes
Draft

A bunch of small LLM-assisted fixes#1049
stv0g wants to merge 43 commits into
masterfrom
llm-fixes

Conversation

@stv0g

@stv0g stv0g commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

The LWS_CALLBACK_CLOSED handler set the connection state to CLOSED and
then compared the (now always CLOSED) state against CLOSING, making the
check dead code. Save the state before overwriting it so the intended
reconnect logic can actually trigger.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The details string contained 'in.epoch=' twice: once for the epoch mode
name and once for the numeric epoch value. Rename the second occurrence
to 'in.epoch_value'.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
strcpy() into the fixed-size sun_path buffer could overflow for long
socket paths. Use strncpy() and force NUL termination.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
strcpy() into the fixed-size ifr_name (IFNAMSIZ) buffer could overflow
for long interface names. Use strncpy() and force NUL termination.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Two 's: b s: b' pairs lacked the separating comma, causing jansson to
mis-parse the format and silently drop some path status fields from the
API/websocket status output.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Rename 'curentPos' to 'currentPos'.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The original code overwrote *dest with the result of realloc() without
checking for NULL, leaking the old buffer and then copying into a NULL
pointer. Also handle vasprintf() failure. On allocation failure the old
buffer is preserved and returned unchanged.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Rename requests/capabiltities.cpp to requests/capabilities.cpp and fix
the 'capabiltities'/'ressource' misspellings in its comment and API
description string (visible in the API index).

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Three issues in the Python Node client:
- config={} was a mutable default argument; use None and create a dict.
- The api_url deduction read the 'config' parameter instead of
  self.config, ignoring a config loaded from config_filename.
- self.child was only created in start(), so is_running() before start()
  raised AttributeError; initialize it to None.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
rt/st were only bound when the corresponding callback was provided, so
calling communicate() with a single callback raised UnboundLocalError
when wait=True. Initialize to None and join conditionally.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
str.strip() returns a new string; the previous code discarded the result
making the strip a no-op. Assign it back to s.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
- Use mark 124 (not 123) for the reverse-path POSTROUTING SNAT rule so
  reverse traffic actually matches the mark set in PREROUTING.
- Use the correct loop variable $inf (was $if) in the debug output.
- Quote $DEBUG in the non-empty test to avoid 'unary operator expected'.
- Replace 'exit -1' (yields 255) with 'exit 1' in die().

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
- Remove two leftover 'exit' statements that aborted the script before
  the qdisc/filter setup ran.
- Use the correct loop variable $inf (was $if) and quote $DEBUG in
  the debug output.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The pattern '.h' lacked the leading wildcard, so plain C headers were
never selected for clang-format. Use '*.h'.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
- format_file() now returns 0 explicitly so a well-formatted (or
  non-existent) file is not miscounted as 'reformatted'.
- Quote file paths.
- Use exit 1 instead of exit -1 (255).

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Unquoted $@ word-splits arguments containing spaces. Use "$@".

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The script targeted the legacy v1 relay API (http://localhost:80/api/v1)
and used the old action/id/request POST envelope. The node mounts its
API at /api/v2 and uses plain REST endpoints. Update the default
endpoint to http://localhost:8080/api/v2 and issue proper GET/POST
requests against /{action}.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The usage string omitted the mandatory RNAME argument even though the
program requires exactly 3 arguments (argc != 4 check) and documents
RNAME in the argument list.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
- should_build() printed '$2' (use) instead of the offending '$3'
  (requirement) in its error message.
- Fix 'dependendency' and "wan't" typos.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The flag comments were off by one (e.g. value 1 labelled '(1 << 1)') and
NEW_SIMULATION (131072) was labelled '(1 << 16)' (it's 1 << 17) and
duplicated NEW_FRAME's description.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
…f-parse.py

- Fix 'Ignroing unkown' comment, 'VLNI' -> 'VLNV' and close the
  unterminated author email angle bracket.
- Remove duplicated axis_register_slice whitelist entry.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Fix typos across headers and sources:
- desciplines/seperately -> disciplines/separately (tc, tc_netem)
- seperated/inferface -> separated/interface (socket_addr)
- occured/occurences -> occurred/occurrences (shmem, list, line, utils)
- precission/destionations -> precision/destinations (utils)
- Compatability -> Compatibility (compat, vfio_container, node_compat, web)
- intialize/initilize/de-intialize -> initialize/.../de-initialize
  (villas-signal, villas-pipe, villas-hook, websocket)
- 'The the' / 'for for' duplicate words (utils.hpp, kernel/if)

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
- substract(ion)/substracted -> subtract(ion)/subtracted
- succesfully -> successfully
- Unrealiable -> Unreliable
- 'adress in hex' -> 'address in hex'

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
…ring

The string literal in the node-type start error path was missing its
terminating quote and the closing parenthesis of the RuntimeError call,
breaking compilation. Close the string and the call.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
These strings surface in 'villas node -h' and the generated usage docs:
- amqp: 'Protoocl' -> 'Protocol'
- example: 'for staring' -> 'for starting'
- temper: 'An temper for staring' -> 'A template for starting'
- villas-test-config: 'plausability' -> 'plausibility'

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Two bugs in parseMode():
- strcmp() returns 0 on match, but the branches tested 'if (strcmp(...))'
  (truthy on mismatch), so the intended mode was never selected.
- The 'max' branch returned Mode::MIN instead of Mode::MAX.

Use '== 0' comparisons and return Mode::MAX for 'max'.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The hook unpacked 'start_freqency'/'end_freqency' (missing the second
'u') while the OpenAPI schema and documentation use 'start_frequency'/
'end_frequency', so documented configs were silently ignored. Read the
correct keys and keep the misspelled ones as a backward-compatible alias.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The option handlers for -w (pulse width), -L (pulse low) and -H (pulse
high) existed but were unreachable because the getopt string lacked those
letters. Add them, document -p (phase, already accepted) and the pulse
options in usage().

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
usage() documented '-d LVL' but the getopt string 'hcVD' had no 'd:', so
the flag was rejected. Add 'd:' and set the log level.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The http schema omitted the 'enabled' boolean that lib/web.cpp parses
under JSON_STRICT (so setting it raised a ConfigError), and declared a
default port of 80 when the actual default is 8080 for unprivileged
users (80 only as root).

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
- zeromq: add the 'pattern' option parsed by the code, and rename the
  curve key 'private_key' to the 'secret_key' the code actually reads.
- websocket: add the 'wait_connected' boolean parsed by the code.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
- redis.conf: 'channel tp be used' -> 'channel to be used'
- ngsi.conf: 'FIRWARE' -> 'FIWARE'

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
…ment

The commented-out alternative referenced 'sequence', but the hook parses
the 'samples' key.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Fix 'managment' -> 'management', 'transfering' -> 'transferring',
and 'occured' -> 'occurred'.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The MovingAverageHook used the 'node-config-hook-rms' error ID
(copy-paste from RMSHook). Use 'node-config-hook-ma' instead so
configuration errors reference the correct documentation anchor.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The optional 'mode' and 'algorithm' keys were unpacked into
uninitialized pointers. When absent, jansson leaves these pointers
untouched, so the subsequent 'if (algorithm_str)' read an
indeterminate pointer (undefined behavior). Initialize them to
nullptr.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
The optional 'mode' key was unpacked into an uninitialized pointer.
When absent, jansson leaves the pointer untouched, so the subsequent
'if (mode_str)' read an indeterminate pointer (undefined behavior).
Initialize it to nullptr.

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
stv0g added 2 commits August 9, 2026 14:27
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>

@leonardocarreras leonardocarreras left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Steffen! I think is generally good. I left comments about cosmetics/intention, but I do not think they are critical, feel free to ignore.


seconds = 10
# sequence = 10
# samples = 10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commented on purpose?

Comment thread lib/path.cpp
json_t *json_path = json_pack(
"{ s: s, s: s, s: s, s: b, s: b s: b, s: b, s: b, s: b s: i, s: o, s: o, "
"{ s: s, s: s, s: s, s: b, s: b, s: b, s: b, s: b, s: b, s: i, s: o, s: "
"o, "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe would be good to merge 677 with 678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants