Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
opentrafficshaper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Francisco Manuel Cardoso
opentrafficshaper
Commits
b002edba
Commit
b002edba
authored
11 years ago
by
Nigel Kukard
Browse files
Options
Downloads
Patches
Plain Diff
IP's must be tracked based on InterfaceGroupID
parent
5eb0d81e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentrafficshaper/plugins/configmanager.pm
+12
-7
12 additions, 7 deletions
opentrafficshaper/plugins/configmanager.pm
with
12 additions
and
7 deletions
opentrafficshaper/plugins/configmanager.pm
+
12
−
7
View file @
b002edba
...
...
@@ -1323,10 +1323,10 @@ sub _process_limit_remove
# Set this UID as no longer using this IP
# NK: If we try remove it before the limit is actually removed we could get a reconnection causing this value
# to be totally gone, which means we not tracking this limit using this IP anymore, not easily solved!!
delete
(
$limitIPMap
->
{
$limit
->
{'
IP
'}}
->
{
$lid
});
delete
(
$limitIPMap
->
{
$limit
->
{'
InterfaceGroupID
'}}
->
{
$limit
->
{'
IP
'}}
->
{
$lid
});
# Check if we can delete the IP too
if
(
keys
%
{
$limitIPMap
->
{
$limit
->
{'
IP
'}}}
==
0
)
{
delete
(
$limitIPMap
->
{
$limit
->
{'
IP
'}});
if
(
keys
%
{
$limitIPMap
->
{
$limit
->
{'
InterfaceGroupID
'}}
->
{
$limit
->
{'
IP
'}}}
==
0
)
{
delete
(
$limitIPMap
->
{
$limit
->
{'
InterfaceGroupID
'}}
->
{
$limit
->
{'
IP
'}});
}
# Remove from change queue
...
...
@@ -1548,11 +1548,16 @@ sub _process_limit_change_queue
my
$updateShaper
=
0
;
# Initialize the IP map if the interface group ID hash is undefined
if
(
!
defined
(
$limitIPMap
->
{
$climit
->
{'
InterfaceGroupID
'}}))
{
$limitIPMap
->
{
$climit
->
{'
InterfaceGroupID
'}}
=
{
};
}
# We first going to look for IP conflicts...
my
@ipLimits
=
keys
%
{
$limitIPMap
->
{
$climit
->
{'
IP
'}}};
my
@ipLimits
=
keys
%
{
$limitIPMap
->
{
$climit
->
{'
InterfaceGroupID
'}}
->
{
$climit
->
{'
IP
'}}};
if
(
# If there is already an entry and its not us ...
(
@ipLimits
==
1
&&
!
defined
(
$limitIPMap
->
{
$climit
->
{'
IP
'}}
->
{
$lid
})
)
(
@ipLimits
==
1
&&
!
defined
(
$limitIPMap
->
{
$climit
->
{'
InterfaceGroupID
'}}
->
{
$climit
->
{'
IP
'}}
->
{
$lid
})
)
# Or if there is more than 1 entry...
||
@ipLimits
>
1
)
{
...
...
@@ -1572,7 +1577,7 @@ sub _process_limit_change_queue
# IP from the shaper below...
foreach
my
$lid2
(
@ipLimits
)
{
# Check if the limit has been setup already (all but the limit we busy with, as its setup below)
if
(
defined
(
$limitIPMap
->
{
$climit
->
{'
IP
'}}
->
{
$lid2
}))
{
if
(
defined
(
$limitIPMap
->
{
$climit
->
{'
InterfaceGroupID
'}}
->
{
$climit
->
{'
IP
'}}
->
{
$lid2
}))
{
my
$glimit2
=
$limits
->
{
$lid2
};
# If the limit is active or pending on the shaper, remove it
...
...
@@ -1594,7 +1599,7 @@ sub _process_limit_change_queue
}
# Set this UID as using this IP
$limitIPMap
->
{
$climit
->
{'
IP
'}}
->
{
$lid
}
=
1
;
$limitIPMap
->
{
$climit
->
{'
InterfaceGroupID
'}}
->
{
$climit
->
{'
IP
'}}
->
{
$lid
}
=
1
;
# This is now live
$limits
->
{
$lid
}
=
$climit
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment