Summary: | [carp] service netif restart causes hang only when carp is enabled | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Dave Cottlehuber <dch> | ||||||
Component: | bin | Assignee: | freebsd-net (Nobody) <net> | ||||||
Status: | New --- | ||||||||
Severity: | Affects Only Me | CC: | admin, kp, zlei | ||||||
Priority: | --- | Keywords: | needs-qa | ||||||
Version: | 11.0-STABLE | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Dave Cottlehuber
2016-10-12 08:16:22 UTC
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 @Kristov Could you include the patch in comment 1 as an attachment please Created attachment 177414 [details]
Change assert into check
^Triage: clear the now obsolete 'patch' keyword. To submitter: is this aging PR still relevant? |