-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow invalid VLAN/VNI value during network creation #1069
Conversation
Currently, netctl parse the pkgTag input as an integer directly. Therefore when user put a garbage in pkgTag, the conversion will default it to 0 instead. This patchset is to cast the input to string and perform further validation logic before we create network Signed-off-by: Kahou Lei <kalei@cisco.com>
netctl/netctl.go
Outdated
var pktTag int | ||
var err error | ||
if len(pktTagInString) > 0 { | ||
pktTag, err = strconv.Atoi(pktTagInString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, drop the declaration of err on 538 and use
pktTag, err := strconv.Atoi(pktTagInString)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't as pktTag need to be used in line 560.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the err, pktTag still decalred on 537, not a blocker
This is the issue refer to contiv/install#182 |
build PR |
isn't it more appropriate to change to cli.Intflag ?https://github.com/contiv/netplugin/blob/master/netctl/commands.go#L219 |
@rchirakk i thought pkt-tag can represent multiple VLAN IDs and VNIs and therefore it was using String for the command input? |
there seems to be a mismatch with expected input values and implementation
@chrisplo please review again |
build PR |
1 similar comment
build PR |
Currently, netctl parse the pkgTag input as an integer directly.
Therefore when user put a garbage in pkgTag, the conversion will
default it to 0 instead.
This patchset is to cast the input to string and perform further
validation logic before we create network
Signed-off-by: Kahou Lei kalei@cisco.com