#include <slirp.h>
-u_int16_t ip_id;
-
/* Number of packets queued before we start sending
* (to prevent allocing too many mbufs) */
#define IF_THRESH 10
int
ip_output(struct socket *so, struct mbuf *m0)
{
+ Slirp *slirp = m0->slirp;
register struct ip *ip;
register struct mbuf *m = m0;
register int hlen = sizeof(struct ip );
*/
ip->ip_v = IPVERSION;
ip->ip_off &= IP_DF;
- ip->ip_id = htons(ip_id++);
+ ip->ip_id = htons(slirp->ip_id++);
ip->ip_hl = hlen >> 2;
/*
mhlen = sizeof (struct ip);
for (off = hlen + len; off < (u_int16_t)ip->ip_len; off += len) {
register struct ip *mhip;
- m = m_get();
+ m = m_get(slirp);
if (m == NULL) {
error = -1;
goto sendorfree;