Skip to content

[dhcpmon] Log Relay-Forward / Relay-Reply counters in v6 status#75

Open
Xichen96 wants to merge 1 commit into
sonic-net:masterfrom
Xichen96:dev/xichenlin/dhcpmon-print-v6-relay-counters
Open

[dhcpmon] Log Relay-Forward / Relay-Reply counters in v6 status#75
Xichen96 wants to merge 1 commit into
sonic-net:masterfrom
Xichen96:dev/xichenlin/dhcpmon-print-v6-relay-counters

Conversation

@Xichen96
Copy link
Copy Markdown
Contributor

@Xichen96 Xichen96 commented May 8, 2026

Why I did it

Follow-up to PR #62 (DHCPv6 support). dhcp_print_counters_v6() only emits the four "endpoint" message types (Solicit, Advertise, Request, Reply). On a relay's upstream interface (e.g. a PortChannel) the only DHCPv6 traffic that ever flows is encapsulated as Relay-Forward (tx) and Relay-Reply (rx), so the per-interval status line for upstream interfaces always reports zeros and the operator has no visibility into the actual relay traffic.

Work item tracking
  • Microsoft ADO (number only): N/A

How I did it

Add a second syslog() call alongside the existing one to print the RELAY_FORW/RELAY_REPL counters. The original line is left untouched (same column widths, same content) so any log tooling that already parses it is unaffected — the new relay counters appear on a fresh line beneath it.

How to verify it

On a v6-relay testbed, drive Relay-Forward / Relay-Reply traffic through an upstream interface (e.g. PortChannel101) and confirm a second status line appears in syslog showing non-zero Relay-Forward/Relay-Reply rx/tx counters for that interface. Existing Solicit/Advertise/Request/Reply line for downstream Vlan interfaces is unchanged.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Tested branch (Please provide the tested image version)

  • master

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

`dhcp_print_counters_v6()` only emits the four "endpoint" message
types (Solicit, Advertise, Request, Reply). On a relay's upstream
interface (e.g. PortChannel) the only DHCPv6 traffic that ever flows
is encapsulated as Relay-Forward (tx) and Relay-Reply (rx), so the
per-interval status line for upstream interfaces always reports
zeros and the operator has no visibility into the actual relay
traffic.

Add a second syslog() call alongside the existing one to print the
RELAY_FORW/RELAY_REPL counters. The original line is left
untouched (same column widths, same content) so any log tooling
that already parses it is unaffected — the relay counters appear
on a new line beneath it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Xichen96 <lukelin0907@gmail.com>
@Xichen96 Xichen96 force-pushed the dev/xichenlin/dhcpmon-print-v6-relay-counters branch from 9d44f99 to f919c2c Compare May 10, 2026 12:22
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants