summaryrefslogtreecommitdiffstats
path: root/sys/net
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
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')
-rw-r--r--sys/net/if_vlan.c7
-rw-r--r--sys/net/if_vlan_var.h2
2 files changed, 4 insertions, 5 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
diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h
index a9679ea..1427b34 100644
--- a/sys/net/if_vlan_var.h
+++ b/sys/net/if_vlan_var.h
@@ -85,7 +85,7 @@ struct vlanreq {
/* shared with if_ethersubr.c: */
extern u_int vlan_proto;
extern int vlan_input(struct ether_header *eh, struct mbuf *m);
-extern void vlan_input_tag(struct ether_header *eh,
+extern int vlan_input_tag(struct ether_header *eh,
struct mbuf *m, u_int16_t t);
#endif
OpenPOWER on IntegriCloud