Commit db8f7b0
committed
cli/command/container: validate --link-local-ip values
The --link-local-ip flag had no validator, and since the move to netip
(v29.0.0) its values are converted with toNetipAddrSlice, which skips
any value it cannot parse. A mistyped address, for example:
docker run --network mynet --link-local-ip 169.254.1.1000 alpine
was silently dropped, and the container was created without it. Before
v29 the value was sent as-is, and the daemon rejected it.
Validate the flag with opts.ValidateIPAddress, the same validator the
--dns flag uses, so an invalid value fails when the flags are parsed.
Assisted-By: Claude Code
Signed-off-by: breken-ai <312387581+breken-ai@users.noreply.github.com>1 parent b48c22e commit db8f7b0
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
769 | 774 | | |
770 | 775 | | |
771 | 776 | | |
| |||
0 commit comments