Kaynağa Gözat

Fixes #2354: Increased maximum MTU for interfaces to 65536 bytes

Jeremy Stretch 7 yıl önce
ebeveyn
işleme
66400a98f1

+ 1 - 0
CHANGELOG.md

@@ -8,6 +8,7 @@ v2.4.4 (FUTURE)
 
 ## Bug Fixes
 
+* [#2354](https://github.com/digitalocean/netbox/issues/2354) - Increased maximum MTU for interfaces to 65536 bytes
 * [#2355](https://github.com/digitalocean/netbox/issues/2355) - Added item count to inventory tab on device view
 * [#2368](https://github.com/digitalocean/netbox/issues/2368) - Record change in device changelog when altering cluster assignment
 * [#2369](https://github.com/digitalocean/netbox/issues/2369) - Corrected time zone validation on site API serializer

+ 19 - 0
netbox/dcim/migrations/0062_interface_mtu.py

@@ -0,0 +1,19 @@
+# Generated by Django 2.0.8 on 2018-08-22 14:23
+
+import django.core.validators
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dcim', '0061_platform_napalm_args'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='interface',
+            name='mtu',
+            field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65536)], verbose_name='MTU'),
+        ),
+    ]

+ 2 - 1
netbox/dcim/models.py

@@ -1809,9 +1809,10 @@ class Interface(ComponentModel):
         blank=True,
         verbose_name='MAC Address'
     )
-    mtu = models.PositiveSmallIntegerField(
+    mtu = models.PositiveIntegerField(
         blank=True,
         null=True,
+        validators=[MinValueValidator(1), MaxValueValidator(65536)],
         verbose_name='MTU'
     )
     mgmt_only = models.BooleanField(