From 20c983d7d22fdb5da5a23c9d61aea1c6206e4230 Mon Sep 17 00:00:00 2001 From: jsonkey Date: Sat, 21 Apr 2018 15:10:18 +0800 Subject: [PATCH] Free mbuf. --- core/lb_synproxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/lb_synproxy.c b/core/lb_synproxy.c index b21bc12..3ad0070 100644 --- a/core/lb_synproxy.c +++ b/core/lb_synproxy.c @@ -316,7 +316,10 @@ synproxy_recv_client_syn(struct rte_mbuf *m, struct ipv4_hdr *iph, if (SYN(th) && !ACK(th) && !RST(th) && !FIN(th) && (vs = lb_vs_get(iph->dst_addr, th->dst_port, iph->next_proto_id)) && (vs->flags & LB_VS_F_SYNPROXY)) { - if (!lb_vs_check_max_conn(vs)) + if (lb_vs_check_max_conn(vs)) + /* Reject connect. */ + rte_pktmbuf_free(m); + else synproxy_sent_client_synack(m, iph, th, port_id); lb_vs_put(vs); return 0; @@ -422,6 +425,8 @@ synproxy_recv_client_ack(struct rte_mbuf *m, struct ipv4_hdr *iph, conn->proxy.isn = rte_be_to_cpu_32(th->recv_ack) - 1; synproxy_sent_backend_syn(m, iph, th, conn, &opts, port_id); + } else { + rte_pktmbuf_free(m); } lb_vs_put(vs);