[pve-devel] [PATCH pve-common 1/3] Inotify: add mtu support

Alexandre DERUMIER aderumier at odiso.com
Mon Jun 25 13:51:26 CEST 2018


Thanks for Wolfgang,

I'll rework my patches for the end of the week. (I'm a lot busy this week).

Could you have a look at my other patches series (networking reload and ifupdown2) ?

Alexandre

----- Mail original -----
De: "Wolfgang Bumiller" <w.bumiller at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Lundi 25 Juin 2018 10:53:29
Objet: Re: [pve-devel] [PATCH pve-common 1/3] Inotify: add mtu support

On Mon, Jun 25, 2018 at 05:41:33AM +0200, Alexandre Derumier wrote: 
> --- 
> src/PVE/INotify.pm | 5 ++++- 
> 1 file changed, 4 insertions(+), 1 deletion(-) 
> 
> diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm 
> index 0b9ea4a..25ab868 100644 
> --- a/src/PVE/INotify.pm 
> +++ b/src/PVE/INotify.pm 
> @@ -875,6 +875,8 @@ sub __read_etc_network_interfaces { 
> 
> if (($id eq 'address') || ($id eq 'netmask') || ($id eq 'broadcast') || ($id eq 'gateway')) { 
> $f->{$id} = $value; 
> + } elsif ($id eq 'mtu') { 
> + $d->{$id} = $value; 
> } elsif ($id eq 'ovs_type' || $id eq 'ovs_options'|| $id eq 'ovs_bridge' || 
> $id eq 'ovs_bonds' || $id eq 'ovs_ports') { 
> $d->{$id} = $value; 
> @@ -1066,9 +1068,10 @@ sub __interface_to_string { 
> $raw .= "\tnetmask " . $d->{"netmask$suffix"} . "\n" if $d->{"netmask$suffix"}; 
> $raw .= "\tgateway " . $d->{"gateway$suffix"} . "\n" if $d->{"gateway$suffix"}; 
> $raw .= "\tbroadcast " . $d->{"broadcast$suffix"} . "\n" if $d->{"broadcast$suffix"}; 
> + $raw .= "\tmtu " . $d->{"mtu$suffix"} . "\n" if $d->{"mtu$suffix"}; 

$suffix is for ipv4 vs ipv6, so just use $d->{mtu} and use $first_block 
as the condition for whether to add it. 

> 
> my $done = { type => 1, priority => 1, method => 1, active => 1, exists => 1, 
> - comments => 1, autostart => 1, options => 1, 
> + comments => 1, autostart => 1, options => 1, mtu => 1, 
> address => 1, netmask => 1, gateway => 1, broadcast => 1, 
> method6 => 1, families => 1, options6 => 1, 
> address6 => 1, netmask6 => 1, gateway6 => 1, broadcast6 => 1 }; 
> -- 
> 2.11.0 




More information about the pve-devel mailing list