summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libalias/alias_db.c26
-rw-r--r--sys/netinet/libalias/alias_db.c26
2 files changed, 20 insertions, 32 deletions
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c
index 86223cd..1ea3413 100644
--- a/lib/libalias/alias_db.c
+++ b/lib/libalias/alias_db.c
@@ -1544,22 +1544,19 @@ SetStateIn(struct alias_link *link, int state)
/* TCP input state */
switch (state) {
case ALIAS_TCP_STATE_DISCONNECTED:
- if (link->data.tcp->state.out != ALIAS_TCP_STATE_CONNECTED) {
+ if (link->data.tcp->state.out != ALIAS_TCP_STATE_CONNECTED)
link->expire_time = TCP_EXPIRE_DEAD;
- } else {
+ else
link->expire_time = TCP_EXPIRE_SINGLEDEAD;
- }
- link->data.tcp->state.in = state;
break;
case ALIAS_TCP_STATE_CONNECTED:
- link->expire_time = TCP_EXPIRE_CONNECTED;
- /*FALLTHROUGH*/
- case ALIAS_TCP_STATE_NOT_CONNECTED:
- link->data.tcp->state.in = state;
+ if (link->data.tcp->state.out == ALIAS_TCP_STATE_CONNECTED)
+ link->expire_time = TCP_EXPIRE_CONNECTED;
break;
default:
abort();
}
+ link->data.tcp->state.in = state;
}
@@ -1569,22 +1566,19 @@ SetStateOut(struct alias_link *link, int state)
/* TCP output state */
switch (state) {
case ALIAS_TCP_STATE_DISCONNECTED:
- if (link->data.tcp->state.in != ALIAS_TCP_STATE_CONNECTED) {
+ if (link->data.tcp->state.in != ALIAS_TCP_STATE_CONNECTED)
link->expire_time = TCP_EXPIRE_DEAD;
- } else {
+ else
link->expire_time = TCP_EXPIRE_SINGLEDEAD;
- }
- link->data.tcp->state.out = state;
break;
case ALIAS_TCP_STATE_CONNECTED:
- link->expire_time = TCP_EXPIRE_CONNECTED;
- /*FALLTHROUGH*/
- case ALIAS_TCP_STATE_NOT_CONNECTED:
- link->data.tcp->state.out = state;
+ if (link->data.tcp->state.in == ALIAS_TCP_STATE_CONNECTED)
+ link->expire_time = TCP_EXPIRE_CONNECTED;
break;
default:
abort();
}
+ link->data.tcp->state.out = state;
}
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c
index 86223cd..1ea3413 100644
--- a/sys/netinet/libalias/alias_db.c
+++ b/sys/netinet/libalias/alias_db.c
@@ -1544,22 +1544,19 @@ SetStateIn(struct alias_link *link, int state)
/* TCP input state */
switch (state) {
case ALIAS_TCP_STATE_DISCONNECTED:
- if (link->data.tcp->state.out != ALIAS_TCP_STATE_CONNECTED) {
+ if (link->data.tcp->state.out != ALIAS_TCP_STATE_CONNECTED)
link->expire_time = TCP_EXPIRE_DEAD;
- } else {
+ else
link->expire_time = TCP_EXPIRE_SINGLEDEAD;
- }
- link->data.tcp->state.in = state;
break;
case ALIAS_TCP_STATE_CONNECTED:
- link->expire_time = TCP_EXPIRE_CONNECTED;
- /*FALLTHROUGH*/
- case ALIAS_TCP_STATE_NOT_CONNECTED:
- link->data.tcp->state.in = state;
+ if (link->data.tcp->state.out == ALIAS_TCP_STATE_CONNECTED)
+ link->expire_time = TCP_EXPIRE_CONNECTED;
break;
default:
abort();
}
+ link->data.tcp->state.in = state;
}
@@ -1569,22 +1566,19 @@ SetStateOut(struct alias_link *link, int state)
/* TCP output state */
switch (state) {
case ALIAS_TCP_STATE_DISCONNECTED:
- if (link->data.tcp->state.in != ALIAS_TCP_STATE_CONNECTED) {
+ if (link->data.tcp->state.in != ALIAS_TCP_STATE_CONNECTED)
link->expire_time = TCP_EXPIRE_DEAD;
- } else {
+ else
link->expire_time = TCP_EXPIRE_SINGLEDEAD;
- }
- link->data.tcp->state.out = state;
break;
case ALIAS_TCP_STATE_CONNECTED:
- link->expire_time = TCP_EXPIRE_CONNECTED;
- /*FALLTHROUGH*/
- case ALIAS_TCP_STATE_NOT_CONNECTED:
- link->data.tcp->state.out = state;
+ if (link->data.tcp->state.in == ALIAS_TCP_STATE_CONNECTED)
+ link->expire_time = TCP_EXPIRE_CONNECTED;
break;
default:
abort();
}
+ link->data.tcp->state.out = state;
}
OpenPOWER on IntegriCloud