Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions src/mod/common/steps/filtering_and_updating.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,16 @@ static enum session_fate tcp_v4_fin_rcv_state(struct session_entry *session,
struct xlation *state)
{
struct packet *pkt = &state->in;
struct tcphdr *hdr;
struct tcphdr *hdr = pkt_tcp_hdr(pkt);

if (pkt_l3_proto(pkt) == L3PROTO_IPV6) {
hdr = pkt_tcp_hdr(pkt);
if (hdr->fin) {
session->state = V4_FIN_V6_FIN_RCV;
return FATE_TIMER_TRANS;
}
if (hdr->rst && handle_rst_during_fin_rcv(state)) {
/* https://github.com/NICMx/Jool/issues/212 */
return FATE_TIMER_TRANS;
}
if (pkt_l3_proto(pkt) == L3PROTO_IPV6 && hdr->fin) {
session->state = V4_FIN_V6_FIN_RCV;
return FATE_TIMER_TRANS;
}

if (hdr->rst && handle_rst_during_fin_rcv(state)) {
/* https://github.com/NICMx/Jool/issues/212 */
return FATE_TIMER_TRANS;
}

return FATE_TIMER_EST;
Expand All @@ -373,18 +371,16 @@ static enum session_fate tcp_v6_fin_rcv_state(struct session_entry *session,
struct xlation *state)
{
struct packet *pkt = &state->in;
struct tcphdr *hdr;
struct tcphdr *hdr = pkt_tcp_hdr(pkt);

if (pkt_l3_proto(pkt) == L3PROTO_IPV4) {
hdr = pkt_tcp_hdr(pkt);
if (hdr->fin) {
session->state = V4_FIN_V6_FIN_RCV;
return FATE_TIMER_TRANS;
}
if (hdr->rst && handle_rst_during_fin_rcv(state)) {
/* https://github.com/NICMx/Jool/issues/212 */
return FATE_TIMER_TRANS;
}
if (pkt_l3_proto(pkt) == L3PROTO_IPV4 && hdr->fin) {
session->state = V4_FIN_V6_FIN_RCV;
return FATE_TIMER_TRANS;
}

if (hdr->rst && handle_rst_during_fin_rcv(state)) {
/* https://github.com/NICMx/Jool/issues/212 */
return FATE_TIMER_TRANS;
}

return FATE_TIMER_EST;
Expand Down