[pve-devel] [PATCH v2 manager 3/4] fix #3893: api: network: add bridge_vids parameter
Fabian Grünbichler
f.gruenbichler at proxmox.com
Fri Nov 10 12:03:46 CET 2023
On June 14, 2023 11:30 am, Aaron Lauterer wrote:
> Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
> ---
> no changes since v1
>
> PVE/API2/Network.pm | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm
> index 00d964a7..6f4367cb 100644
> --- a/PVE/API2/Network.pm
> +++ b/PVE/API2/Network.pm
> @@ -66,6 +66,11 @@ my $confdesc = {
> type => 'boolean',
> optional => 1,
> },
> + bridge_vids => {
> + description => "Specify the allowed vlans. For example: '2 4 100-200'. Only used if the bridge is VLAN aware.",
> + optional => 1,
> + type => 'string', format => 'pve-bridge-vid-list',
unfortunately, pve-bridge-vid-list allows more than intended. we'd
either need to define a custom type for the lists, or improve the
handling. a `-list` format under the hood calls PVE::Tools::split_list,
which splits on zero bytes if the string contains one, or else on ',',
';' and whitespace.. and at least ';' leads to ifreload not applying the
VLAN settings (with a warning that is very easy to miss, since it
doesn't show up in the task log or task status at all, you only see it
if you run `ifreload -av`!).
two possible solutions:
- use a custom format here, split and call the verify helper from
pve-common
- use -list here, but map the other delimiters to ' ' either here or in
pve-common
side-note: this is basically the "trunks" format, but with a different
delimiter, couldn't we have a common option/format and just change the
delimiter based on what we pass it along to?
> + },
> bridge_ports => {
> description => "Specify the interfaces you want to add to your bridge.",
> optional => 1,
> --
> 2.39.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
More information about the pve-devel
mailing list