Lines 1517-1522
Link Here
|
1517 |
u_int32_t timeout; |
1517 |
u_int32_t timeout; |
1518 |
|
1518 |
|
1519 |
if (s->src_node != NULL) { |
1519 |
if (s->src_node != NULL) { |
|
|
1520 |
|
1521 |
/* Remove this pf_state from the list of states linked to pf_src_node */ |
1522 |
if (s->prev_state) /* not the first pf_state in list */ |
1523 |
s->prev_state->next_state = s->next_state; |
1524 |
else /* the fist pf_state in the list, modify list head in pf_src_node */ |
1525 |
s->src_node->linked_states = s->next_state; |
1526 |
|
1527 |
if (s->next_state) /* not the last pf_state in list */ |
1528 |
s->next_state->prev_state = s->prev_state; |
1529 |
|
1530 |
s->prev_state = NULL; |
1531 |
s->next_state = NULL; |
1532 |
|
1520 |
if (s->src.tcp_est) |
1533 |
if (s->src.tcp_est) |
1521 |
--s->src_node->conn; |
1534 |
--s->src_node->conn; |
1522 |
if (--s->src_node->states <= 0) { |
1535 |
if (--s->src_node->states <= 0) { |
Lines 1532-1537
Link Here
|
1532 |
} |
1545 |
} |
1533 |
} |
1546 |
} |
1534 |
if (s->nat_src_node != s->src_node && s->nat_src_node != NULL) { |
1547 |
if (s->nat_src_node != s->src_node && s->nat_src_node != NULL) { |
|
|
1548 |
|
1549 |
/* Remove this pf_state from the list of states linked to pf_src_node */ |
1550 |
if (s->prev_state) /* not the first pf_state in list */ |
1551 |
s->prev_state->next_state = s->next_state; |
1552 |
else /* the fist pf_state in the list, modify list head in pf_src_node */ |
1553 |
s->nat_src_node->linked_states = s->next_state; |
1554 |
|
1555 |
if (s->next_state) /* not the last pf_state in list */ |
1556 |
s->next_state->prev_state = s->prev_state; |
1557 |
|
1558 |
s->prev_state = NULL; |
1559 |
s->next_state = NULL; |
1560 |
|
1535 |
if (--s->nat_src_node->states <= 0) { |
1561 |
if (--s->nat_src_node->states <= 0) { |
1536 |
timeout = s->rule.ptr->timeout[PFTM_SRC_NODE]; |
1562 |
timeout = s->rule.ptr->timeout[PFTM_SRC_NODE]; |
1537 |
if (!timeout) |
1563 |
if (!timeout) |
Lines 3895-3906
Link Here
|
3895 |
if (sn != NULL) { |
3921 |
if (sn != NULL) { |
3896 |
s->src_node = sn; |
3922 |
s->src_node = sn; |
3897 |
s->src_node->states++; |
3923 |
s->src_node->states++; |
|
|
3924 |
|
3925 |
/* attach this state to head of list */ |
3926 |
s->next_state = sn->linked_states; |
3927 |
if (s->next_state) |
3928 |
s->next_state->prev_state = s; |
3929 |
sn->linked_states = s; |
3898 |
} |
3930 |
} |
3899 |
if (nsn != NULL) { |
3931 |
if (nsn != NULL) { |
3900 |
/* XXX We only modify one side for now. */ |
3932 |
/* XXX We only modify one side for now. */ |
3901 |
PF_ACPY(&nsn->raddr, &nk->addr[1], pd->af); |
3933 |
PF_ACPY(&nsn->raddr, &nk->addr[1], pd->af); |
3902 |
s->nat_src_node = nsn; |
3934 |
s->nat_src_node = nsn; |
3903 |
s->nat_src_node->states++; |
3935 |
s->nat_src_node->states++; |
|
|
3936 |
|
3937 |
/* attach this state to head of list */ |
3938 |
s->next_state = nsn->linked_states; |
3939 |
if (s->next_state) |
3940 |
s->next_state->prev_state = s; |
3941 |
nsn->linked_states = s; |
3904 |
} |
3942 |
} |
3905 |
if (pd->proto == IPPROTO_TCP) { |
3943 |
if (pd->proto == IPPROTO_TCP) { |
3906 |
if ((pd->flags & PFDESC_TCP_NORM) && pf_normalize_tcp_init(m, |
3944 |
if ((pd->flags & PFDESC_TCP_NORM) && pf_normalize_tcp_init(m, |