Revision b5a87d26

b/slirp/tcp_input.c
316 316
	m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
317 317
	m->m_len  -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
318 318

  
319
    if (slirp->restricted) {
320
        for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) {
321
            if (ex_ptr->ex_fport == ti->ti_dport &&
322
                ti->ti_dst.s_addr == ex_ptr->ex_addr.s_addr) {
323
                break;
324
            }
325
        }
326
        if (!ex_ptr)
327
            goto drop;
328
    }
329 319
	/*
330 320
	 * Locate pcb for segment.
331 321
	 */
......
355 345
	 * as if it was LISTENING, and continue...
356 346
	 */
357 347
        if (so == NULL) {
348
          if (slirp->restricted) {
349
            /* Any hostfwds will have an existing socket, so we only get here
350
             * for non-hostfwd connections. These should be dropped, unless it
351
             * happens to be a guestfwd.
352
             */
353
            for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) {
354
                if (ex_ptr->ex_fport == ti->ti_dport &&
355
                    ti->ti_dst.s_addr == ex_ptr->ex_addr.s_addr) {
356
                    break;
357
                }
358
            }
359
            if (!ex_ptr) {
360
                goto dropwithreset;
361
            }
362
          }
363

  
358 364
	  if ((tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) != TH_SYN)
359 365
	    goto dropwithreset;
360 366

  

Also available in: Unified diff