netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.93k stars 2.56k forks source link

If multiple RD value with separator will be set in VRF, we can get unusable situation for parse result and automation #4184

Closed pnpwin closed 4 years ago

pnpwin commented 4 years ago

Environment

Hi. Because you use in https://github.com/netbox-community/netbox/blob/151943bfbc8e0d2b2a5055dc5ab03d7c1ea6847d/netbox/ipam/models.py#L46 model CharField - we can get unusable situations like this: telegram-cloud-photo-size-2-5354915051301088467-y

If multiple RD value with separator will be in this field, we can get unusable situation for parse result and automation.

Maybe you can use model for RD field and try to check-on-save value with this description https://tools.ietf.org/html/rfc4364#page-14 ?

Steps to Reproduce

  1. Open or create VRF;
  2. Set multiple RD value with separator;
  3. Save.

Expected Behavior

Observed Behavior

DanSheps commented 4 years ago

The route distinguisher field is a free-form field. I don't believe we do any validation on the RD field, as this is more of a end user thing.

If you would like to have a FR for some more validation around the field, please request a re-open with a use case around the change and what database changes may be required.