Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146358421
D19422.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D19422.diff
View Options
Index: head/sys/net/if_vxlan.c
===================================================================
--- head/sys/net/if_vxlan.c
+++ head/sys/net/if_vxlan.c
@@ -84,6 +84,15 @@
int vxlsomc_users;
};
+/*
+ * The maximum MTU of encapsulated ethernet frame within IPv4/UDP packet.
+ */
+#define VXLAN_MAX_MTU (IP_MAXPACKET - \
+ 60 /* Maximum IPv4 header len */ - \
+ sizeof(struct udphdr) - \
+ sizeof(struct vxlan_header) - \
+ ETHER_HDR_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)
+
#define VXLAN_SO_MC_MAX_GROUPS 32
#define VXLAN_SO_VNI_HASH_SHIFT 6
@@ -2247,10 +2256,11 @@
ifr = (struct ifreq *) data;
ifd = (struct ifdrv *) data;
+ error = 0;
+
switch (cmd) {
case SIOCADDMULTI:
case SIOCDELMULTI:
- error = 0;
break;
case SIOCGDRVSPEC:
@@ -2267,6 +2277,13 @@
error = ifmedia_ioctl(ifp, ifr, &sc->vxl_media, cmd);
break;
+ case SIOCSIFMTU:
+ if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > VXLAN_MAX_MTU)
+ error = EINVAL;
+ else
+ ifp->if_mtu = ifr->ifr_mtu;
+ break;
+
default:
error = ether_ioctl(ifp, cmd, data);
break;
@@ -2747,8 +2764,8 @@
ifp->if_ioctl = vxlan_ioctl;
ifp->if_transmit = vxlan_transmit;
ifp->if_qflush = vxlan_qflush;
- ifp->if_capabilities |= IFCAP_LINKSTATE;
- ifp->if_capenable |= IFCAP_LINKSTATE;
+ ifp->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU;
+ ifp->if_capenable |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU;
ifmedia_init(&sc->vxl_media, 0, vxlan_media_change, vxlan_media_status);
ifmedia_add(&sc->vxl_media, IFM_ETHER | IFM_AUTO, 0, NULL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 3, 1:29 AM (24 m, 41 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29176340
Default Alt Text
D19422.diff (1 KB)
Attached To
Mode
D19422: if_vxlan(4) Allow set MTU more than 1500 bytes.
Attached
Detach File
Event Timeline
Log In to Comment