Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sdmmc Don't pass empty mbufs to the network stack.



details:   https://anonhg.NetBSD.org/src/rev/d82ef5a31db3
branches:  trunk
changeset: 454297:d82ef5a31db3
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Fri Sep 13 11:21:03 2019 +0000

description:
Don't pass empty mbufs to the network stack.

diffstat:

 sys/dev/sdmmc/if_bwfm_sdio.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 3be039ce3219 -r d82ef5a31db3 sys/dev/sdmmc/if_bwfm_sdio.c
--- a/sys/dev/sdmmc/if_bwfm_sdio.c      Fri Sep 13 11:01:49 2019 +0000
+++ b/sys/dev/sdmmc/if_bwfm_sdio.c      Fri Sep 13 11:21:03 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.4 2019/09/01 05:51:45 mlelstv Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.5 2019/09/13 11:21:03 mlelstv Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -1614,6 +1614,11 @@
                                break;
                        }
                        m_adj(m, hoff);
+                       /* don't pass empty packet to stack */
+                       if (m->m_len == 0) {
+                               m_freem(m);
+                               break;
+                       }
                        bwfm_rx(&sc->sc_sc, m);
                        nextlen = swhdr->nextlen << 4;
                        break;
@@ -1752,6 +1757,11 @@
                                break;
                        }
                        m_adj(m, hoff);
+                       /* don't pass empty packet to stack */
+                       if (m->m_len == 0) {
+                               m_freem(m);
+                               break;
+                       }
                        bwfm_rx(&sc->sc_sc, m);
                        break;
                case BWFM_SDIO_SWHDR_CHANNEL_GLOM:



Home | Main Index | Thread Index | Old Index