diff options
author | Rafael Zalamena <rzalamena@cvs.openbsd.org> | 2016-09-16 18:41:21 +0000 |
---|---|---|
committer | Rafael Zalamena <rzalamena@cvs.openbsd.org> | 2016-09-16 18:41:21 +0000 |
commit | 4027b0abcddef2eacd3b8a21a93a02c738958603 (patch) | |
tree | 8a1a9b712a36b241a1b7ee407904d447daed208c | |
parent | e244eaf5bc43b1f0976c189248aa727201204e69 (diff) |
Fix the data storage size check. When we exceed the amount of available
storage within an mbuf packet header we have to allocate a cluster.
Pointed out by mikeb@
ok mikeb@
-rw-r--r-- | sys/net/switchofp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c index 2fc1521710b..3f1e87919ca 100644 --- a/sys/net/switchofp.c +++ b/sys/net/switchofp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switchofp.c,v 1.3 2016/09/04 16:47:41 goda Exp $ */ +/* $OpenBSD: switchofp.c,v 1.4 2016/09/16 18:41:20 rzalamena Exp $ */ /* * Copyright (c) 2016 Kazuya GODA <goda@openbsd.org> @@ -3047,7 +3047,7 @@ swofp_action_output_controller(struct switch_softc *sc, struct mbuf *m0, MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); - if ((sizeof(*pin) + match_len) >= MINCLSIZE){ + if ((sizeof(*pin) + match_len) >= MHLEN) { MCLGET(m, M_DONTWAIT); if (m == NULL) return (ENOBUFS); |