16_x less restrictive DDP header acceptance & bugfix#5554
Conversation
WalkthroughThis PR adds packet length validation throughout the E1.31/DDP protocol handling pipeline. It propagates the incoming UDP packet length from the async parser through the callback chain and handler signature, uses it to validate DDP packet structure and filter unsupported packet types, changes color type handling to accept all data types by defaulting to RGB, and tightens DMX channel validation. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as UDP/WebSocket Client
participant Parser as ESPAsyncE131 Parser
participant Handler as handleE131Packet
participant DDP as DDP Processor
Client->>Parser: Send packet (payload + length)
Parser->>Parser: Capture packet length
Note over Parser: Validate min length for E1.31/Art-Net<br/>before ACN ID check
Parser->>Handler: Dispatch callback(packet, IP, protocol, packetLen)
Handler->>Handler: Receive packetLen parameter
alt Protocol is DDP
Handler->>DDP: Process with packetLen
DDP->>DDP: Validate header length
DDP->>DDP: Check if actual length satisfies<br/>header + data expectations
DDP->>DDP: Filter packet types<br/>(drop control/status/config/query)
DDP->>DDP: Resolve color type<br/>(accept unknown, default to RGB)
DDP->>DDP: Render pixels if PUSH flag set
else Protocol is E1.31
Handler->>Handler: Validate DMX channel count > 0
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
this is basically the same as #5547 but with the uncertain buffer checks for e131 packets removed
Summary by CodeRabbit
Release Notes
Bug Fixes
Improvements