Revision 5fafdf24 slirp/ip_output.c

b/slirp/ip_output.c
65 65
	DEBUG_CALL("ip_output");
66 66
	DEBUG_ARG("so = %lx", (long)so);
67 67
	DEBUG_ARG("m0 = %lx", (long)m0);
68
	
68

  
69 69
	/* We do no options */
70 70
/*	if (opt) {
71 71
 *		m = ip_insertoptions(m, opt, &len);
......
92 92
 *		goto bad;
93 93
 *	}
94 94
 */
95
	
95

  
96 96
	/*
97 97
	 * If small enough for interface, can just send directly.
98 98
	 */
......
115 115
		ipstat.ips_cantfrag++;
116 116
		goto bad;
117 117
	}
118
	
118

  
119 119
	len = (if_mtu - hlen) &~ 7;       /* ip databytes per packet */
120 120
	if (len < 8) {
121 121
		error = -1;
......
143 143
	  m->m_data += if_maxlinkhdr;
144 144
	  mhip = mtod(m, struct ip *);
145 145
	  *mhip = *ip;
146
		
146
	
147 147
		/* No options */
148 148
/*		if (hlen > sizeof (struct ip)) {
149 149
 *			mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
......
156 156
	    mhip->ip_off |= IP_MF;
157 157
	  if (off + len >= (u_int16_t)ip->ip_len)
158 158
	    len = (u_int16_t)ip->ip_len - off;
159
	  else 
159
	  else
160 160
	    mhip->ip_off |= IP_MF;
161 161
	  mhip->ip_len = htons((u_int16_t)(len + mhlen));
162
	  
162
	 
163 163
	  if (m_copy(m, m0, off, len) < 0) {
164 164
	    error = -1;
165 165
	    goto sendorfree;
166 166
	  }
167
	  
167
	 
168 168
	  mhip->ip_off = htons((u_int16_t)mhip->ip_off);
169 169
	  mhip->ip_sum = 0;
170 170
	  mhip->ip_sum = cksum(m, mhlen);

Also available in: Unified diff