Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
27cc006a
Commit
27cc006a
authored
Feb 12, 2015
by
Leigh B Stoller
Browse files
Randomize tags when reserving one of a block.
parent
67ecb016
Changes
2
Hide whitespace changes
Inline
Side-by-side
protogeni/lib/GeniCMV2.pm.in
View file @
27cc006a
...
...
@@ -67,6 +67,7 @@ use Compress::Zlib;
use
File
::
Temp
qw
(
tempfile
);
use
MIME
::
Base64
;
use
Errno
;
use
List
::
Util
qw
(
shuffle
);
#
Configure
variables
my
$
TB
=
"@prefix@"
;
...
...
@@ -2173,7 +2174,7 @@ sub ReserveVlanTags($)
#
my
$
vlanid
=
$
vlan
->
lanid
();
my
$
tag
=
undef
;
my
@
tmp
=
@
tags
;
my
@
tmp
=
shuffle
(
@
tags
)
;
while
(@
tmp
)
{
$
tag
=
pop
(@
tmp
);
if
($
vlan
->
ReserveVlanTag
($
tag
,
1
))
{
...
...
tbsetup/snmpit_test/snmpit_test.in
View file @
27cc006a
#!/usr/bin/perl -w
#
# Copyright (c) 2000-201
4
University of Utah and the Flux Group.
# Copyright (c) 2000-201
5
University of Utah and the Flux Group.
#
# {{{EMULAB-LGPL
#
...
...
@@ -47,6 +47,7 @@ use English;
use
Getopt::
Long
;
use
emutil
;
use
strict
;
use
List::
Util
qw(shuffle)
;
# Optional alternate version of libraries.
use
lib
'
@prefix@/lib/snmpit_test
';
...
...
@@ -2820,6 +2821,8 @@ sub doReserveVlanTags($$@) {
#
if
(
exists
(
$optvlantags
{
$vlanid
}))
{
@tags
=
@
{
$optvlantags
{
$vlanid
}
};
# Shuffle for better handling.
@tags
=
shuffle
(
@tags
);
}
elsif
(
$vlan
->
GetReservedVlanTag
())
{
# Wanted any tag, but lan has a tag.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment