Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143872747
D36855.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D36855.diff
View Options
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -2504,7 +2504,7 @@
struct ip *ip;
struct in_addr srcaddr, dstaddr;
uint16_t srcport, dstport;
- int len, mcast, error;
+ int plen, mcast, error;
struct route route, *ro;
struct sockaddr_in *sin;
uint32_t csum_flags;
@@ -2517,6 +2517,7 @@
dstaddr = fvxlsa->in4.sin_addr;
dstport = fvxlsa->in4.sin_port;
+ plen = m->m_pkthdr.len;
M_PREPEND(m, sizeof(struct ip) + sizeof(struct vxlanudphdr),
M_NOWAIT);
if (m == NULL) {
@@ -2524,11 +2525,9 @@
return (ENOBUFS);
}
- len = m->m_pkthdr.len;
-
ip = mtod(m, struct ip *);
ip->ip_tos = 0;
- ip->ip_len = htons(len);
+ ip->ip_len = htons(m->m_pkthdr.len);
ip->ip_off = 0;
ip->ip_ttl = sc->vxl_ttl;
ip->ip_p = IPPROTO_UDP;
@@ -2594,7 +2593,7 @@
error = ip_output(m, NULL, ro, 0, sc->vxl_im4o, NULL);
if (error == 0) {
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
- if_inc_counter(ifp, IFCOUNTER_OBYTES, len);
+ if_inc_counter(ifp, IFCOUNTER_OBYTES, plen);
if (mcast != 0)
if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
} else
@@ -2616,7 +2615,7 @@
struct ip6_hdr *ip6;
const struct in6_addr *srcaddr, *dstaddr;
uint16_t srcport, dstport;
- int len, mcast, error;
+ int plen, mcast, error;
struct route_in6 route, *ro;
struct sockaddr_in6 *sin6;
uint32_t csum_flags;
@@ -2629,6 +2628,7 @@
dstaddr = &fvxlsa->in6.sin6_addr;
dstport = fvxlsa->in6.sin6_port;
+ plen = m->m_pkthdr.len;
M_PREPEND(m, sizeof(struct ip6_hdr) + sizeof(struct vxlanudphdr),
M_NOWAIT);
if (m == NULL) {
@@ -2636,8 +2636,6 @@
return (ENOBUFS);
}
- len = m->m_pkthdr.len;
-
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_flow = 0; /* BMV: Keep in forwarding entry? */
ip6->ip6_vfc = IPV6_VERSION;
@@ -2712,7 +2710,7 @@
error = ip6_output(m, NULL, ro, 0, sc->vxl_im6o, NULL, NULL);
if (error == 0) {
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
- if_inc_counter(ifp, IFCOUNTER_OBYTES, len);
+ if_inc_counter(ifp, IFCOUNTER_OBYTES, plen);
if (mcast != 0)
if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
} else
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 2, 8:21 AM (10 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28411130
Default Alt Text
D36855.diff (2 KB)
Attached To
Mode
D36855: if_vxlan(4): Correct the statistic for output bytes
Attached
Detach File
Event Timeline
Log In to Comment