diff --git a/include/gatekeeper_net.h b/include/gatekeeper_net.h index b48ab4ba..48f25a86 100644 --- a/include/gatekeeper_net.h +++ b/include/gatekeeper_net.h @@ -102,7 +102,7 @@ enum { * Need forward declaration because acl_cb_func and struct gatekeeper_if * are circularly defined. */ -struct gatekeeper_if *iface; +struct gatekeeper_if; typedef int (*acl_cb_func)(struct rte_mbuf **pkts, unsigned int num_pkts, struct gatekeeper_if *iface); /* Format of function called when no rule matches in the IPv6 ACL. */ diff --git a/lib/net.c b/lib/net.c index 5c5207f2..0673f390 100644 --- a/lib/net.c +++ b/lib/net.c @@ -1691,7 +1691,10 @@ log_if_name(char *if_name, size_t len, const struct gatekeeper_if *iface, } } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-truncation" strncpy(if_name, iface->name, len); +#pragma GCC diagnostic pop if (unlikely(if_name[len - 1] != '\0')) { G_LOG(CRIT, "%s(%s/%u): bug: len = %lu < strlen(iface->name) = %lu\n", __func__, iface->name, port_id,