Page MenuHomeFreeBSD

D59391.id185821.diff
No OneTemporary

D59391.id185821.diff

diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -3940,6 +3940,7 @@
struct llc llc1;
u_int16_t ether_type;
pfil_return_t rv;
+ struct ifnet *errifp = (bifp != NULL) ? bifp : ifp;
#ifdef INET
struct ip *ip = NULL;
int hlen = 0;
@@ -3966,7 +3967,7 @@
*mp = m_pullup(*mp, ETHER_HDR_LEN);
if (*mp == NULL) {
printf("%s: m_pullup failed\n", __func__);
- return (-1);
+ goto bad;
}
}
@@ -3989,7 +3990,7 @@
ETHER_HDR_LEN + sizeof(struct llc));
if (*mp == NULL) {
printf("%s: m_pullup failed\n", __func__);
- return (-1);
+ goto bad;
}
eh1 = mtod(*mp, struct ether_header *);
}
@@ -4127,6 +4128,8 @@
if (i > ifp->if_mtu) {
error = bridge_fragment(ifp, mp, &eh2, snap,
&llc1);
+ if (error != 0)
+ if_inc_counter(errifp, IFCOUNTER_OERRORS, 1);
return (error);
}
}
@@ -4191,18 +4194,20 @@
if (snap) {
M_PREPEND(*mp, sizeof(struct llc), M_NOWAIT);
if (*mp == NULL)
- return (error);
+ goto bad;
bcopy(&llc1, mtod(*mp, caddr_t), sizeof(struct llc));
}
M_PREPEND(*mp, ETHER_HDR_LEN, M_NOWAIT);
if (*mp == NULL)
- return (error);
+ goto bad;
bcopy(&eh2, mtod(*mp, caddr_t), ETHER_HDR_LEN);
return (0);
bad:
+ if_inc_counter(errifp,
+ dir == PFIL_IN ? IFCOUNTER_IERRORS : IFCOUNTER_OERRORS, 1);
m_freem(*mp);
*mp = NULL;
return (error);
@@ -4380,8 +4385,10 @@
int error = -1;
if (m->m_len < sizeof(struct ip) &&
- (m = m_pullup(m, sizeof(struct ip))) == NULL)
+ (m = m_pullup(m, sizeof(struct ip))) == NULL) {
+ KMOD_IPSTAT_INC(ips_odropped);
goto dropit;
+ }
ip = mtod(m, struct ip *);
m->m_pkthdr.csum_flags |= CSUM_IP;
@@ -4400,6 +4407,7 @@
M_PREPEND(mcur, sizeof(struct llc), M_NOWAIT);
if (mcur == NULL) {
error = ENOBUFS;
+ KMOD_IPSTAT_INC(ips_odropped);
if (mprev != NULL)
mprev->m_nextpkt = nextpkt;
goto dropit;
@@ -4410,6 +4418,7 @@
M_PREPEND(mcur, ETHER_HDR_LEN, M_NOWAIT);
if (mcur == NULL) {
error = ENOBUFS;
+ KMOD_IPSTAT_INC(ips_odropped);
if (mprev != NULL)
mprev->m_nextpkt = nextpkt;
goto dropit;

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 12, 10:00 PM (1 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38338853
Default Alt Text
D59391.id185821.diff (2 KB)

Event Timeline