Skip to content

Commit

Permalink
TCP alias lookup: Add matching by transport
Browse files Browse the repository at this point in the history
Further improving commit 13970bb.

(cherry picked from commit ea699f0)
  • Loading branch information
liviuchircu committed May 24, 2016
1 parent 1a93613 commit bc5f651
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/net_tcp.c
Expand Up @@ -732,9 +732,11 @@ int tcpconn_add_alias(int id, int port, int proto)
if (c){
hash=tcp_addr_hash(&c->rcv.src_ip, port);
/* search the aliases for an already existing one */
for (a=TCP_PART(id).tcpconn_aliases_hash[hash]; a; a=a->next){
if ( (a->parent->state!=S_CONN_BAD) && (port==a->port) &&
(ip_addr_cmp(&c->rcv.src_ip, &a->parent->rcv.src_ip)) ){
for (a=TCP_PART(id).tcpconn_aliases_hash[hash]; a; a=a->next) {
if (a->parent->state != S_CONN_BAD &&
port == a->port &&
proto == a->parent->type &&
ip_addr_cmp(&c->rcv.src_ip, &a->parent->rcv.src_ip)) {
/* found */
if (a->parent!=c) goto error_sec;
else goto ok;
Expand Down

0 comments on commit bc5f651

Please sign in to comment.