Skip to content

Commit

Permalink
Fix a bug where existing v6 CARP alias addresses cannot be changed.
Browse files Browse the repository at this point in the history
Ticket #6892
  • Loading branch information
loos-br committed Dec 21, 2016
1 parent 56c0b07 commit 580e1b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sys/netinet6/in6.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,11 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
*/
if ((error = in6_update_ifa(ifp, ifra, ia, 0)) != 0)
goto out;
if (ia != NULL)
if (ia != NULL) {
if (ia->ia_ifa.ifa_carp)
(*carp_detach_p)(&ia->ia_ifa, false);
ifa_free(&ia->ia_ifa);
}
if ((ia = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr))
== NULL) {
/*
Expand Down Expand Up @@ -622,7 +625,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
*/
if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) {
if (carp_attached)
(*carp_detach_p)(&ia->ia_ifa, false);
(*carp_detach_p)(&ia->ia_ifa, true);
goto out;
}
}
Expand Down

0 comments on commit 580e1b6

Please sign in to comment.