Revision 511d2b14 slirp/tcp_input.c

b/slirp/tcp_input.c
121 121
	int flags;
122 122

  
123 123
	/*
124
	 * Call with ti==0 after become established to
124
	 * Call with ti==NULL after become established to
125 125
	 * force pre-ESTABLISHED data up to user socket.
126 126
	 */
127
	if (ti == 0)
127
        if (ti == NULL)
128 128
		goto present;
129 129

  
130 130
	/*
......
230 230
 * protocol specification dated September, 1981 very closely.
231 231
 */
232 232
void
233
tcp_input(m, iphlen, inso)
234
	register struct mbuf *m;
235
	int iphlen;
236
	struct socket *inso;
233
tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
237 234
{
238 235
  	struct ip save_ip, *ip;
239 236
	register struct tcpiphdr *ti;
240 237
	caddr_t optp = NULL;
241 238
	int optlen = 0;
242 239
	int len, tlen, off;
243
	register struct tcpcb *tp = 0;
240
        register struct tcpcb *tp = NULL;
244 241
	register int tiflags;
245
	struct socket *so = 0;
242
        struct socket *so = NULL;
246 243
	int todrop, acked, ourfinisacked, needoutput = 0;
247 244
/*	int dropsocket = 0; */
248 245
	int iss = 0;
......
264 261
		/* Re-set a few variables */
265 262
		tp = sototcpcb(so);
266 263
		m = so->so_m;
267
		so->so_m = 0;
264
                so->so_m = NULL;
268 265
		ti = so->so_ti;
269 266
		tiwin = ti->ti_win;
270 267
		tiflags = ti->ti_flags;
......
298 295
	 * Checksum extended TCP header and data.
299 296
	 */
300 297
	tlen = ((struct ip *)ti)->ip_len;
301
	tcpiphdr2qlink(ti)->next = tcpiphdr2qlink(ti)->prev = 0;
302
    memset(&ti->ti_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));
298
        tcpiphdr2qlink(ti)->next = tcpiphdr2qlink(ti)->prev = NULL;
299
        memset(&ti->ti_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));
303 300
	ti->ti_x1 = 0;
304 301
	ti->ti_len = htons((u_int16_t)tlen);
305 302
	len = sizeof(struct ip ) + tlen;
......
399 396
	 * the only flag set, then create a session, mark it
400 397
	 * as if it was LISTENING, and continue...
401 398
	 */
402
	if (so == 0) {
399
        if (so == NULL) {
403 400
	  if ((tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) != TH_SYN)
404 401
	    goto dropwithreset;
405 402

  
......
439 436
	tp = sototcpcb(so);
440 437

  
441 438
	/* XXX Should never fail */
442
	if (tp == 0)
439
        if (tp == NULL)
443 440
		goto dropwithreset;
444 441
	if (tp->t_state == TCPS_CLOSED)
445 442
		goto drop;
......
1697 1694
 */
1698 1695

  
1699 1696
int
1700
tcp_mss(tp, offer)
1701
        register struct tcpcb *tp;
1702
        u_int offer;
1697
tcp_mss(struct tcpcb *tp, u_int offer)
1703 1698
{
1704 1699
	struct socket *so = tp->t_socket;
1705 1700
	int mss;

Also available in: Unified diff