influxdata / influxdata/telegraf

socket_listener plugin does not bind to specific address, causes conflic if multiple are defined.

Open
#17,203 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Relevant telegraf.conf

```toml
First conf file:
[[inputs.socket_listener]]
alias="xxxPLC-xxx-{{ xxx_number }}-GRP-2"
service_address = "udp://224.0.7.2:18246%enp7s0"
data_format = "binary"
#endianess = "be"

[inputs.socket_listener.tags]
group_id = "2"
decanter_id = "{{ xxx_number }}"

Second conf file:
[[inputs.socket_listener]]
alias="xxxPLC-xxx-{{ xxx_number }}-GRP-1"
service_address = "udp://224.0.7.1:18246%enp7s0"
data_format = "binary"
#endianess = "be"

[inputs.socket_listener.tags]
group_id = "1"
decanter_id = "{{ xxx_number }}"
```

### Logs from Telegraf

```text
startup message:
2025-06-16T21:33:13Z I! [inputs.socket_listener::xxxPLC-xxx-3-GRP-1] Listening on udp://0.0.0.0:18246
2025-06-16T21:33:13Z I! [inputs.socket_listener::xxxPLC-xxx-3-GRP-2] Listening on udp://0.0.0.0:18246

running log:
2025-06-16T21:06:43Z E! [inputs.socket_listener::xxxPLC-xxx-3-GRP-1] Error in plugin: out-of-bounds @448 with 16 bits
2025-06-16T21:06:43Z E! [inputs.socket_listener::xxxPLC-xxx-3-GRP-1] Error in plugin: out-of-bounds @448 with 16 bits
```

### System info

Telegraf 1.34.4 (git: HEAD@e7ce1e1e) Debian GNU/Linux 12 (bookworm)

### Docker

n/a

### Steps to reproduce

1. configure two separate conf files that specify
2. telegraf startup message binds to 0.0.0.0 (all addresses) <- not desired behaviour... should be specific address

### Expected behavior

socket listener should bind to specified address in the socket_listener conf file.

### Actual behavior

socket_listener binds to all addresses, if there are multiple definitions telegraf tries to parse the incorrect EGD message coming in since the payload differs on each of the x.x.7.1 and x.x.7.2 addresses. In the PLC the EGD (ethernet global data) exchange may have up to 32 group ids which are mapped to a specific IP address. 224.0.7.1-32 in this specific controller.

### Additional info

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the socket_listener plugin and its service_address handling, using the two configuration examples and startup logs as the reproduction. Verify how multiple listener definitions are bound and confirm that each listens on its configured multicast address rather than 0.0.0.0; done means distinct addresses no longer receive or parse each other's payloads.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.