Print this page
14025 ipnet sniffing leaks promisc mode

*** 24,34 **** * Use is subject to license terms. * Copyright (c) 2016 by Delphix. All rights reserved. */ /* ! * Copyright (c) 2016, Joyent, Inc. All rights reserved. */ /* * The ipnet device defined here provides access to packets at the IP layer. To * provide access to packets at this layer it registers a callback function in --- 24,34 ---- * Use is subject to license terms. * Copyright (c) 2016 by Delphix. All rights reserved. */ /* ! * Copyright 2021 Joyent, Inc. */ /* * The ipnet device defined here provides access to packets at the IP layer. To * provide access to packets at this layer it registers a callback function in
*** 2243,2252 **** --- 2243,2253 ---- regfail: cmn_err(CE_WARN, "net_hook_register failed: %d", error); strfree(ipnet->ipnet_hook->h_name); hook_free(ipnet->ipnet_hook); + ipnet_leave_allmulti(ifp, ns->netstack_ipnet); netstack_rele(ns); return (error); } void
*** 2268,2277 **** --- 2269,2280 ---- strfree(hook->h_name); hook_free(hook); + ipnet_leave_allmulti(ipnet->ipnet_if, ipnet->ipnet_ns->netstack_ipnet); + kmem_free(ipnet, sizeof (*ipnet)); } /* * arg here comes from the ipnet_t allocated in ipnet_promisc_add.