https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213410

Kristof Provost <k...@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |k...@freebsd.org

--- Comment #1 from Kristof Provost <k...@freebsd.org> ---
I’ve had a very quick look, and at first glance it seems like an overly strict
KASSERT() more than anything else.
Basically, during service netif restart the scripts try to set up carp on an
address that’s already got it configured. That runs into the assert and panics
the box (or actually panics later on if INVARIANTS is not set).

Simply replacing the KASSERT with a check (and returning errors) prevents the
panic.
I don’t have a carp test setup, but this should make things a lot better
already.

Can you check if this works for you?

diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index
7855af2..ea27f0a 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1804,7 +1804,8 @@ carp_attach(struct ifaddr *ifa, int vhid)
        struct carp_softc *sc;
        int index, error;

-       KASSERT(ifa->ifa_carp == NULL, ("%s: ifa %p attached", __func__, ifa));
+       if (ifa->ifa_carp != NULL)
+               return (EBUSY);

        switch (ifa->ifa_addr->sa_family) {
 #ifdef INET

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to