Skip to content

Commit

Permalink
dpvs: fix ipo option length bug when insert ipo.
Browse files Browse the repository at this point in the history
Length of ipo is sizeof(struct ipopt_uoa) + IPv4_addr_length = 8.
  • Loading branch information
roykingz committed Aug 10, 2023
1 parent 0dd5120 commit 89e8c30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ipvs/ip_vs_proto_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 89e8c30

Please sign in to comment.