From 89e8c30efbe92f6b93a7d6818d066804c3a1cb75 Mon Sep 17 00:00:00 2001 From: roykingz Date: Thu, 10 Aug 2023 09:27:04 +0800 Subject: [PATCH] dpvs: fix ipo option length bug when insert ipo. Length of ipo is sizeof(struct ipopt_uoa) + IPv4_addr_length = 8. --- src/ipvs/ip_vs_proto_udp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipvs/ip_vs_proto_udp.c b/src/ipvs/ip_vs_proto_udp.c index 4adecb4bf..0a3a51b85 100644 --- a/src/ipvs/ip_vs_proto_udp.c +++ b/src/ipvs/ip_vs_proto_udp.c @@ -454,9 +454,9 @@ static int insert_ipopt_uoa(struct dp_vs_conn *conn, struct rte_mbuf *mbuf, struct ipopt_uoa *optuoa; assert(AF_INET == tuplehash_in(conn).af && AF_INET == tuplehash_out(conn).af); - if ((ip4_hdrlen(mbuf) + sizeof(struct ipopt_uoa) > + if ((ip4_hdrlen(mbuf) + IPOLEN_UOA_IPV4 > sizeof(struct iphdr) + MAX_IPOPTLEN) - || (mbuf->pkt_len + sizeof(struct ipopt_uoa) > mtu)) + || (mbuf->pkt_len + IPOLEN_UOA_IPV4 > mtu)) goto standalone_uoa; /*