summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1999-12-13 01:57:00 +0000
committerjkh <jkh@FreeBSD.org>1999-12-13 01:57:00 +0000
commitce079123e3550908356dfbaf3f42672876a55777 (patch)
tree123e328319b9797e7b713b3769a9cd2f8d41deed /sys/net/if_vlan.c
parent72de1aee50403c65a63d9fd52176203f003a5441 (diff)
downloadFreeBSD-src-ce079123e3550908356dfbaf3f42672876a55777.zip
FreeBSD-src-ce079123e3550908356dfbaf3f42672876a55777.tar.gz
The current code incorrectly assumes that all vlans
are configured, and/or associated with a parent device. If you receive a frame for a VLAN that's not in the list, you walk off the end of the list. Boom. Submitted by: C. Stephen Gunn <csg@waterspout.com> PR: 15291
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r--sys/net/if_vlan.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index d8639d4..218bff7 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -285,9 +285,8 @@ vlan_input_tag(struct ether_header *eh, struct mbuf *m, u_int16_t t)
}
if (i >= NVLAN || (ifv->ifv_if.if_flags & IFF_UP) == 0) {
- m_freem(m);
- ifv->ifv_p->if_data.ifi_noproto++;
- return;
+ m_free(m);
+ return -1; /* So the parent can take note */
}
/*
@@ -312,7 +311,7 @@ vlan_input_tag(struct ether_header *eh, struct mbuf *m, u_int16_t t)
}
ifv->ifv_if.if_ipackets++;
ether_input(&ifv->ifv_if, eh, m);
- return;
+ return 0;
}
int
OpenPOWER on IntegriCloud