net: tap_plug() needs to apply rate limiting

Any action we take in tap_plug() when using OVS will undo
our rate limiting, which means any hotplug change must
restore the previous rate setting.
Since this means tap_plug() would always be followed by a
tap_rate_limit() call anyway we just include the rate
parameter here and let the caller decide whether the full
tap_plug() is required or the simple tap_rate_limit()
suffices.
This commit is contained in:
Wolfgang Bumiller 2016-03-08 14:14:13 +01:00 committed by Dietmar Maurer
parent c58f205b5c
commit 683d81c2a2

View File

@ -217,7 +217,7 @@ my $cleanup_firewall_bridge = sub {
};
sub tap_plug {
my ($iface, $bridge, $tag, $firewall) = @_;
my ($iface, $bridge, $tag, $firewall, $rate) = @_;
#cleanup old port config from any openvswitch bridge
eval {run_command("/usr/bin/ovs-vsctl del-port $iface", outfunc => sub {}, errfunc => sub {}) };
@ -240,6 +240,8 @@ sub tap_plug {
&$ovs_bridge_add_port($bridge, $iface, $tag);
}
}
tap_rate_limit($iface, $rate);
}
sub tap_unplug {