Commit fc9009f
authored
[ AGNTLOG-700 ] Honor bind_host on UDP log listeners (DataDog#54487)
### What does this PR do?
UDP log listeners now bind to the address configured in `bind_host` instead of always listening on the wildcard address. TCP log listeners already honored the setting; the UDP listener built its listen address from the port alone and silently discarded `bind_host`. Sources that leave `bind_host` unset are unaffected and continue to listen on all interfaces.
### Motivation
`bind_host` is documented as applying to both TCP and UDP log sources, so an operator restricting a UDP syslog listener to a specific management interface would reasonably expect the port to be reachable only there. In practice the socket was bound to the IPv6 wildcard address and accepted datagrams on every interface, which makes this a silent exposure rather than merely an ignored option.
The release note is updated as if this was a new feature for TCP AND UDP, because the specific bind host functionality can be separated from the preview feature the option was previously soft-gated behind.
### Describe how you validated your changes
`TestUDPBindHost` was added, mirroring the existing `TestTCPBindHost`, and confirmed to fail against the previous behavior — the listener reported `[::]:<port>` rather than the configured address. The full package suite passes via `dda inv test --targets=./pkg/logs/launchers/listener` (31 tests), alongside `dda inv linter.go --only-modified-packages`.
### Additional Notes
No configuration migration is required: an empty `bind_host` still resolves to `:<port>`, preserving the all-interfaces default.
Co-authored-by: ryan.hall <ryan.hall@datadoghq.com>1 parent 29de702 commit fc9009f
3 files changed
Lines changed: 33 additions & 1 deletion
File tree
- pkg/logs/launchers/listener
- releasenotes/notes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
50 | 76 | | |
51 | 77 | | |
52 | 78 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments