Skip to content

Commit

Permalink
Print unicast peer addresses in /tmp/keepalived.data
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
  • Loading branch information
pqarmitage committed Sep 2, 2017
1 parent 046808b commit eb64954
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions keepalived/vrrp/vrrp_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ address_print(FILE *file, void *data)
, ipaddr->label ? ipaddr->label : "");
}

static void
sockaddr_print(FILE *file, void *data)
{
struct sockaddr_storage *addr = data;

fprintf(file, " %s\n", inet_sockaddrtos(addr));
}

#ifdef _HAVE_FIB_ROUTING_
static void
route_print(FILE *file, void *data)
Expand Down Expand Up @@ -325,6 +333,11 @@ vrrp_print(FILE *file, void *data)
LIST_SIZE(vrrp->evip));
vrrp_print_list(file, vrrp->evip, &address_print);
}
if (!LIST_ISEMPTY(vrrp->unicast_peer)) {
fprintf(file, " Unicast Peer = %d\n",
LIST_SIZE(vrrp->unicast_peer));
vrrp_print_list(file, vrrp->unicast_peer, &sockaddr_print);
}
#ifdef _HAVE_FIB_ROUTING_
if (!LIST_ISEMPTY(vrrp->vroutes)) {
fprintf(file, " Virtual Routes = %d\n", LIST_SIZE(vrrp->vroutes));
Expand Down

0 comments on commit eb64954

Please sign in to comment.