Index: /trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/ip_icmp.c	(revision 27447)
+++ /trunk/src/VBox/Devices/Network/slirp/ip_icmp.c	(revision 27448)
@@ -585,5 +585,5 @@
     m->m_pkthdr.header = mtod(m, void *);
 #else
-    new_m_size = sizeof(struct ip) + ICMP_MINLEN + msrc->m_len + ICMP_MAXDATALEN;
+    new_m_size = if_maxlinkhdr + sizeof(struct ip) + ICMP_MINLEN + msrc->m_len + ICMP_MAXDATALEN;
     if (new_m_size > m->m_size)
     {
Index: /trunk/src/VBox/Devices/Network/slirp/libslirp.h
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/libslirp.h	(revision 27447)
+++ /trunk/src/VBox/Devices/Network/slirp/libslirp.h	(revision 27448)
@@ -119,5 +119,4 @@
 void slirp_ext_m_free(PNATState pData, struct mbuf *);
 #ifndef VBOX_WITH_SLIRP_BSD_MBUF
-void slirp_ext_m_append(PNATState pData, struct mbuf *, uint8_t *, size_t);
 void slirp_push_recv_thread(void *pvUser);
 #endif
Index: /trunk/src/VBox/Devices/Network/slirp/mbuf.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/mbuf.c	(revision 27447)
+++ /trunk/src/VBox/Devices/Network/slirp/mbuf.c	(revision 27448)
@@ -402,17 +402,3 @@
 }
 
-void slirp_ext_m_append(PNATState pData, struct mbuf *m, uint8_t *pu8Buf, size_t cbBuf)
-{
-    char *c;
-    if (cbBuf > M_FREEROOM(m))
-    {
-        m_inc(m, cbBuf);
-        if (RT_UNLIKELY(cbBuf > M_FREEROOM(m)))
-            cbBuf = M_FREEROOM(m);
-    }
-    c = mtod(m, char *);
-    memcpy(c, pu8Buf, cbBuf);
-    m->m_len = cbBuf;
-}
-
 #endif /* VBOX_WITH_SLIRP_BSD_MBUF */
Index: /trunk/src/VBox/Devices/Network/slirp/socket.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/socket.c	(revision 27447)
+++ /trunk/src/VBox/Devices/Network/slirp/socket.c	(revision 27448)
@@ -1060,5 +1060,5 @@
     {
        Log(("send_icmp_to_guest: ICMP header is too small to understand which type/subtype of the datagram\n"));
-       return; 
+       return;
     }
     icp = (struct icmp *)((char *)ip + hlen);
@@ -1073,5 +1073,5 @@
 
     /*
-     * ICMP_ECHOREPLY, ICMP_TIMXCEED, ICMP_UNREACH minimal header size is 
+     * ICMP_ECHOREPLY, ICMP_TIMXCEED, ICMP_UNREACH minimal header size is
      * ICMP_ECHOREPLY assuming data 0
      * icmp_{type(8), code(8), cksum(16),identifier(16),seqnum(16)}
@@ -1081,5 +1081,5 @@
         Log(("send_icmp_to_guest: NAT accept ICMP_{ECHOREPLY, TIMXCEED, UNREACH} the minimum size is 64 (see rfc792)\n"));
         return;
-    } 
+    }
 
     type = icp->icmp_type;
@@ -1088,5 +1088,5 @@
     {
         /*
-         * ICMP_TIMXCEED, ICMP_UNREACH minimal header size is 
+         * ICMP_TIMXCEED, ICMP_UNREACH minimal header size is
          * icmp_{type(8), code(8), cksum(16),unused(32)} + IP header + 64 bit of original datagram
          */
@@ -1095,5 +1095,5 @@
             Log(("send_icmp_to_guest: NAT accept ICMP_{TIMXCEED, UNREACH} the minimum size of ipheader + 64 bit of data (see rfc792)\n"));
             return;
-        } 
+        }
         ip = &icp->icmp_ip;
     }
@@ -1148,19 +1148,17 @@
     /* saves original ip header and options */
     /* m_room space in the saved m buffer */
-    m_room = m->m_len + M_TRAILINGSPACE(m) - original_hlen;
-    if (m_room >= len - hlen)
-        memcpy(m->m_data + original_hlen, buff + hlen, len - hlen);
-    else 
-    {
-        int size = m->m_size;
-        /* we need involve ether header lenght into new buffer buffer calculation */
-        m_inc(m, if_maxlinkhdr + len - hlen + original_hlen); 
-        if (size == m->m_size)
+    m_room = M_ROOM(m);
+    if (m_room < len - hlen + original_hlen)
+    else
+    {
+        /* we need involve ether header length into new buffer buffer calculation */
+        m_inc(m, if_maxlinkhdr + len - hlen + original_hlen);
+        if (m->m_size < if_maxlinkhdr + len - hlen + original_hlen)
         {
             Log(("send_icmp_to_guest: extending buffer was failed (packet is dropped)\n"));
             return;
         }
-        memcpy(m->m_data + original_hlen, buff + hlen, len - hlen);
-    }
+    }
+    memcpy(m->m_data + original_hlen, buff + hlen, len - hlen);
 #ifndef VBOX_WITH_SLIRP_BSD_MBUF
     m->m_len = len - hlen + original_hlen;
@@ -1390,10 +1388,10 @@
             || errno == ENOTCONN))
     {
-        Log(("sorecvfrom_icmp_unix: 2 - step can't read IP body (would block expected:%d)\n", 
+        Log(("sorecvfrom_icmp_unix: 2 - step can't read IP body (would block expected:%d)\n",
             RT_N2H_U16(ip.ip_len)));
         RTMemFree(buff);
         return;
     }
-    if (   len < 0 
+    if (   len < 0
         || len < (RT_N2H_U16(ip.ip_len))
         || len == 0)
