]> git.proxmox.com Git - mirror_qemu.git/blobdiff - slirp/ip_input.c
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[mirror_qemu.git] / slirp / ip_input.c
index 12f173de6cf4025c605941911802116067be087e..348e1dca5ab3299a9ecf640264180364a66dcf15 100644 (file)
@@ -39,8 +39,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
-#include <qemu/osdep.h>
+#include "slirp.h"
 #include "ip_icmp.h"
 
 static struct ip *ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp);
@@ -80,12 +79,16 @@ ip_input(struct mbuf *m)
        register struct ip *ip;
        int hlen;
 
+       if (!slirp->in_enabled) {
+               goto bad;
+       }
+
        DEBUG_CALL("ip_input");
        DEBUG_ARG("m = %p", m);
        DEBUG_ARG("m_len = %d", m->m_len);
 
        if (m->m_len < sizeof (struct ip)) {
-               return;
+               goto bad;
        }
 
        ip = mtod(m, struct ip *);