Skip to content

Commit

Permalink
icmp6: use dpdk macro for pointer arithmetic
Browse files Browse the repository at this point in the history
Use RTE_PTR_ADD instead of manual operations.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
rjarry committed Oct 23, 2024
1 parent 120435b commit 055e2e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/infra/datapath/gr_icmp6.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <gr_macro.h>

#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_ether.h>
#include <rte_ip6.h>

Expand Down Expand Up @@ -148,7 +149,7 @@ icmp6_get_opt(const struct icmp6_opt *opt, size_t ip6_len, uint8_t type, void *v
}
next:
ip6_len -= opt->len * 8;
opt = (struct icmp6_opt *)((char *)opt + (opt->len * 8));
opt = RTE_PTR_ADD(opt, opt->len * 8);
}
return false;
}
Expand Down

0 comments on commit 055e2e3

Please sign in to comment.