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>
There was a problem hiding this comment.
nit, drop the declaration of err on 538 and use
pktTag, err := strconv.Atoi(pktTagInString)
There was a problem hiding this comment.
I can't as pktTag need to be used in line 560.
There was a problem hiding this comment.
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 |

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