diff --git a/modules/load_balancer/lb_bl.c b/modules/load_balancer/lb_bl.c index 764ba01048d..55fc410d121 100644 --- a/modules/load_balancer/lb_bl.c +++ b/modules/load_balancer/lb_bl.c @@ -189,8 +189,8 @@ int populate_lb_bls(struct lb_dst *dest_list) add_rule_to_list( &lbbl_first, &lbbl_last, group_net, NULL/*body*/, - 0/*port*/, - PROTO_NONE/*proto*/, + dst->ports[j], + dst->protos[j], 0/*flags*/); pkg_free(group_net); } diff --git a/modules/load_balancer/lb_data.c b/modules/load_balancer/lb_data.c index 6d177427e71..3c810373cca 100644 --- a/modules/load_balancer/lb_data.c +++ b/modules/load_balancer/lb_data.c @@ -303,6 +303,7 @@ int add_lb_dsturi( struct lb_data *data, int id, int group, char *uri, } hostent2ip_addr( &dst->ips[0], &proxy->host, proxy->addr_idx); dst->ports[0] = proxy->port; + dst->protos[0] = proxy->proto; dst->ips_cnt = 1; LM_DBG("first dst ip addr [%s]:%d\n", ip_addr2a(&dst->ips[0]), dst->ports[0]); @@ -310,8 +311,10 @@ int add_lb_dsturi( struct lb_data *data, int id, int group, char *uri, while (dst->ips_cntips[dst->ips_cnt], &sau); dst->ports[dst->ips_cnt] = proxy->port; - LM_DBG("additional dst ip addr [%s]:%d\n", - ip_addr2a(&dst->ips[dst->ips_cnt]), dst->ports[dst->ips_cnt]); + dst->protos[dst->ips_cnt] = proxy->proto; + LM_DBG("additional dst ip addr [%s]:%d, proto %d\n", + ip_addr2a(&dst->ips[dst->ips_cnt]), + dst->ports[dst->ips_cnt], dst->protos[dst->ips_cnt] ); /* one more IP found */ dst->ips_cnt++; } diff --git a/modules/load_balancer/lb_data.h b/modules/load_balancer/lb_data.h index 3941aa55469..3cc9c50150b 100644 --- a/modules/load_balancer/lb_data.h +++ b/modules/load_balancer/lb_data.h @@ -73,6 +73,7 @@ struct lb_dst { struct lb_resource_map *rmap; struct ip_addr ips[LB_MAX_IPS]; /* IP-Address of the entry */ unsigned short int ports[LB_MAX_IPS]; /* Port of the request URI */ + unsigned short int protos[LB_MAX_IPS]; /* Protocol of the request URI */ unsigned short ips_cnt; struct lb_dst *next; };