Skip to content

Commit

Permalink
Merge pull request #833 from ywc689/bugfix-ubuntu
Browse files Browse the repository at this point in the history
fix some compile problems found on ubuntu
  • Loading branch information
ywc689 authored Jul 14, 2022
2 parents b42c3a2 + fe34ab1 commit 72db9e3
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ $ make # or "make -j" to speed up
$ make install
```
> Notes:
> 1. Build dependencies may be needed, such as `pkg-config`(version 0.29.2+),`automake`, `libnl3`, `libnl-genl-3.0`, `openssl`, `popt` and `numactl`. You can install the missing dependencies by using the package manager of the system, e.g., `yum install popt-devel` (CentOS).
> 1. Build dependencies may be needed, such as `pkg-config`(version 0.29.2+),`automake`, `libnl3`, `libnl-genl-3.0`, `openssl`, `popt` and `numactl`. You can install the missing dependencies by using the package manager of the system, e.g., `yum install popt-devel automake` (CentOS) or `apt install libpopt-dev autoconfig` (Ubuntu).
> 2. Early `pkg-config` versions (v0.29.2 before) may cause dpvs build failure. If so, please upgrade this tool.
Output files are installed to `dpvs/bin`.
Expand Down
2 changes: 1 addition & 1 deletion include/conf/neigh.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct dp_vs_neigh_conf {
char ifname[IFNAMSIZ];
uint8_t flag;
uint8_t cid;
}__attribute__((__packed__));
}__attribute__((__packed__, aligned(2)));

struct dp_vs_neigh_conf_array {
int neigh_nums;
Expand Down
2 changes: 1 addition & 1 deletion scripts/dpdk-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ echo -e "DPDK library installed successfully into directory: \033[32m$(pwd)/dpdk
## export dpdk lib
echo -e "You can use this library in dpvs by running the command below:"
echo -e "\033[32m"
echo -e "export PKG_CONFIG_PATH=$(pwd)/dpdklib/lib64/pkgconfig"
echo -e "export PKG_CONFIG_PATH=$(find $(pwd) -name pkgconfig)"
echo -e "\033[0m"
1 change: 1 addition & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ CFLAGS += -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -mcmodel=medium
ifeq ($(shell test $(GCC_VERSION) -ge 70 && echo 1), 1)
CFLAGS += -Wno-format-truncation
CFLAGS += -Wno-stringop-truncation
CFLAGS += -Wno-address-of-packed-member
CFLAGS += -Wstringop-overflow=0
endif

Expand Down
1 change: 1 addition & 0 deletions tools/dpip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ TARGET = build/dpip

CFLAGS = -g -O0
CFLAGS += -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
CFLAGS += -Wno-address-of-packed-member

CFLAGS += -I ../../include
CFLAGS += -I ../keepalived/keepalived/include
Expand Down
2 changes: 1 addition & 1 deletion tools/dpip/ipset.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ ipset_check(const struct dpip_obj *obj, dpip_cmd_t cmd)
static void
bitmap_dump_header(char *buf, struct ipset_info *info)
{
char range[50];
char range[128];
char addr[INET6_ADDRSTRLEN], addr2[INET6_ADDRSTRLEN];

if (info->bitmap.cidr) {
Expand Down
8 changes: 4 additions & 4 deletions tools/keepalived/keepalived/check/check_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ udp_check_thread(thread_ref_t thread)
if (recv_buf)
FREE(recv_buf);

return;
return 0;
}

static int
Expand All @@ -331,15 +331,15 @@ udp_connect_thread(thread_ref_t thread)
if (!checker->enabled) {
thread_add_timer(thread->master, udp_connect_thread, checker,
checker->delay_loop);
return;
return 0;
}

if ((fd = socket(co->dst.ss_family, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, IPPROTO_UDP)) == -1) {
log_message(LOG_INFO, "UDP connect fail to create socket. Rescheduling.");
thread_add_timer(thread->master, udp_connect_thread, checker,
checker->delay_loop);

return;
return 0;
}

status = udp_bind_connect(fd, co, udp_check->payload, udp_check->payload_len);
Expand All @@ -350,7 +350,7 @@ udp_connect_thread(thread_ref_t thread)
udp_epilog(thread, false);
}

return;
return 0;
}

#ifdef THREAD_DUMP
Expand Down
15 changes: 14 additions & 1 deletion tools/keepalived/keepalived/include/ip_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//
/////////////////////////////////////////////////////////////////////////////////////////

#define IP_VS_VERSION_CODE 0x010808 /* DPVS v1.8.8 */
#define IP_VS_VERSION_CODE 0x010902 /* DPVS v1.9.2 */
#define NVERSION(version) \
(version >> 16) & 0xFF, \
(version >> 8) & 0xFF, \
Expand Down Expand Up @@ -85,6 +85,19 @@
#define IP_VS_SO_GET_LADDRS (IP_VS_BASE_CTL+8)
#define IP_VS_SO_GET_MAX IP_VS_SO_GET_LADDRS

/* Tunnel types */
enum {
IP_VS_CONN_F_TUNNEL_TYPE_IPIP = 0, /* IPIP */
IP_VS_CONN_F_TUNNEL_TYPE_GUE, /* GUE */
IP_VS_CONN_F_TUNNEL_TYPE_GRE, /* GRE */
IP_VS_CONN_F_TUNNEL_TYPE_MAX,
};

/* Tunnel encapsulation flags */
#define IP_VS_TUNNEL_ENCAP_FLAG_NOCSUM (0)
#define IP_VS_TUNNEL_ENCAP_FLAG_CSUM (1 << 0)
#define IP_VS_TUNNEL_ENCAP_FLAG_REMCSUM (1 << 1)

/*
* The struct ip_vs_service_user and struct ip_vs_dest_user are
* used to set IPVS rules through setsockopt.
Expand Down

0 comments on commit 72db9e3

Please sign in to comment.