Summary: | Kernel panics when setting IP address if net.link.ether.inet.garp_rexmit_count=2 | ||
---|---|---|---|
Product: | Base System | Reporter: | Pete French <pete> |
Component: | kern | Assignee: | Kristof Provost <kp> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | kp, net, vangyzen |
Priority: | --- | Keywords: | crash, patch |
Version: | 12.0-STABLE | Flags: | koobs:
mfc-stable12+
koobs: mfc-stable11+ |
Hardware: | Any | ||
OS: | Any |
Description
Pete French
2019-02-12 16:12:15 UTC
That looks like another case of CURVNET not being set. This should fix it: diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index f278fa1b3ca..c84fcee3328 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1335,6 +1335,8 @@ garp_rexmit(void *arg) return; } + CURVNET_SET(ia->ia_ifa.ifa_ifp->if_vnet); + /* * Drop lock while the ARP request is generated. */ @@ -1362,6 +1364,8 @@ garp_rexmit(void *arg) ifa_free(&ia->ia_ifa); } } + + CURVNET_RESTORE(); } /* The patch looks good to me. A commit references this bug: Author: kp Date: Tue Feb 12 21:22:58 UTC 2019 New revision: 344061 URL: https://svnweb.freebsd.org/changeset/base/344061 Log: garp: Fix vnet related panic for gratuitous arp Gratuitous ARP packets are sent from a timer, which means we don't have a vnet context set. As a result we panic trying to send the packet. Set the vnet context based on the interface associated with the interface address. To reproduce: sysctl net.link.ether.inet.garp_rexmit_count=2 ifconfig vtnet1 10.0.0.1/24 up PR: 235699 Reviewed by: vangyzen@ MFC after: 1 week Changes: head/sys/netinet/if_ether.c A commit references this bug: Author: kp Date: Tue Feb 19 18:22:56 UTC 2019 New revision: 344281 URL: https://svnweb.freebsd.org/changeset/base/344281 Log: MFC r344061: garp: Fix vnet related panic for gratuitous arp Gratuitous ARP packets are sent from a timer, which means we don't have a vnet context set. As a result we panic trying to send the packet. Set the vnet context based on the interface associated with the interface address. To reproduce: sysctl net.link.ether.inet.garp_rexmit_count=2 ifconfig vtnet1 10.0.0.1/24 up PR: 235699 Reviewed by: vangyzen@ Changes: _U stable/12/ stable/12/sys/netinet/if_ether.c A commit references this bug: Author: kp Date: Tue Feb 19 18:22:57 UTC 2019 New revision: 344282 URL: https://svnweb.freebsd.org/changeset/base/344282 Log: MFC r344061: garp: Fix vnet related panic for gratuitous arp Gratuitous ARP packets are sent from a timer, which means we don't have a vnet context set. As a result we panic trying to send the packet. Set the vnet context based on the interface associated with the interface address. To reproduce: sysctl net.link.ether.inet.garp_rexmit_count=2 ifconfig vtnet1 10.0.0.1/24 up PR: 235699 Reviewed by: vangyzen@ Changes: _U stable/11/ stable/11/sys/netinet/if_ether.c |