Skip to content

Commit

Permalink
Merge pull request #2347 from pqarmitage/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
pqarmitage committed Oct 1, 2023
2 parents 8aaeed0 + 37d449a commit 5a54d67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion keepalived/core/keepalived_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ address_is_ours(struct ifaddrmsg *ifa, struct in_addr *addr, interface_t *ifp)
vip_list;
vip_list = vip_list == &vrrp->vip ? &vrrp->evip : NULL) {
list_for_each_entry(ip_addr, vip_list, e_list) {
if (addr_is_equal(ifa, addr, ip_addr, ifp))
if (addr_is_equal(ifa, addr, ip_addr, ifp) &&
ifa->ifa_prefixlen == ip_addr->ifa.ifa_prefixlen)
return ip_addr->dont_track ? NULL : vrrp;
}
}
Expand Down
10 changes: 8 additions & 2 deletions keepalived/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ start_validate_reload_conf_child(void)
int fd;
int len;
char exe_buf[128];
struct stat sb;

exe_buf[sizeof(exe_buf) - 1] = '\0';
ret = readlink("/proc/self/exe", exe_buf, sizeof(exe_buf));
Expand Down Expand Up @@ -1055,8 +1056,13 @@ start_validate_reload_conf_child(void)
script.uid = 0;
script.gid = 0;

if (truncate(global_data->reload_check_config, 0) && errno != ENOENT)
log_message(LOG_INFO, "truncate of config check log %s failed (%d) - %m", global_data->reload_check_config, errno);
if (truncate(global_data->reload_check_config, 0) && errno != ENOENT) {
/* The file exists, but truncate failed. It might be a character
* device like /dev/null. truncate() returns EINVAL in this case. */
if (stat(global_data->reload_check_config, &sb) ||
!S_ISCHR(sb.st_mode))
log_message(LOG_INFO, "truncate of config check log %s failed (%d) - %m", global_data->reload_check_config, errno);
}

create_reload_file();

Expand Down

0 comments on commit 5a54d67

Please sign in to comment.