GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
768 stars 258 forks source link

Switch port type missing input validation? #2334

Closed spikefishjohn closed 5 months ago

spikefishjohn commented 6 months ago

GNS3 2.3.3.1.. uh.. Custom...

I've been playing with ansible + gns3 and noticed I had a type on a switch port which set command (dot1 vs dot1). I then tried setting it to bugs.

curl -X PUT 'http://127.0.0.1:3080/v2/compute/projects/546d66f9-b9a4-4021-b651-a8e043944807/ethernet_switch/nodes/ebe62463-d9a5-4603-98b3-6a75ec496236' -d '{"ports_mapping": [{"ethertype": "", "name": "Ethernet0", "port_number": 0, "type": "dot1q", "vlan": 1}, {"ethertype": "", "name": "Ethernet1", "port_number": 1, "type": "dot1q", "vlan": 1}, {"ethertype": "", "name": "Ethernet2", "port_number": 2, "type": "bugs", "vlan": 1}], "name": "Switch1", "console": 7043, "console_type": "none"}'

Worked fine!

image

I'm assuming the only 3 valid inputs for a switch node port type are ("access", "dot1q" or "qinq" ).

grossmj commented 5 months ago

Fixed, thanks 👍