if_clone.c (152779) | if_clone.c (159781) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 |
30 * $FreeBSD: head/sys/net/if_clone.c 152779 2005-11-24 18:56:14Z ru $ | 30 * $FreeBSD: head/sys/net/if_clone.c 159781 2006-06-19 22:20:45Z mlaier $ |
31 */ 32 33#include <sys/param.h> 34#include <sys/malloc.h> 35#include <sys/limits.h> 36#include <sys/lock.h> 37#include <sys/mutex.h> 38#include <sys/kernel.h> --- 114 unchanged lines hidden (view full) --- 153 154 err = (*ifc->ifc_create)(ifc, name, len); 155 156 if (!err) { 157 ifp = ifunit(name); 158 if (ifp == NULL) 159 panic("%s: lookup failed for %s", __func__, name); 160 | 31 */ 32 33#include <sys/param.h> 34#include <sys/malloc.h> 35#include <sys/limits.h> 36#include <sys/lock.h> 37#include <sys/mutex.h> 38#include <sys/kernel.h> --- 114 unchanged lines hidden (view full) --- 153 154 err = (*ifc->ifc_create)(ifc, name, len); 155 156 if (!err) { 157 ifp = ifunit(name); 158 if (ifp == NULL) 159 panic("%s: lookup failed for %s", __func__, name); 160 |
161 if_addgroup(ifp, ifc->ifc_name); 162 |
|
161 IF_CLONE_LOCK(ifc); 162 IFC_IFLIST_INSERT(ifc, ifp); 163 IF_CLONE_UNLOCK(ifc); 164 } 165 166 return (err); 167} 168 --- 36 unchanged lines hidden (view full) --- 205 err = EOPNOTSUPP; 206 goto done; 207 } 208 209 IF_CLONE_LOCK(ifc); 210 IFC_IFLIST_REMOVE(ifc, ifp); 211 IF_CLONE_UNLOCK(ifc); 212 | 163 IF_CLONE_LOCK(ifc); 164 IFC_IFLIST_INSERT(ifc, ifp); 165 IF_CLONE_UNLOCK(ifc); 166 } 167 168 return (err); 169} 170 --- 36 unchanged lines hidden (view full) --- 207 err = EOPNOTSUPP; 208 goto done; 209 } 210 211 IF_CLONE_LOCK(ifc); 212 IFC_IFLIST_REMOVE(ifc, ifp); 213 IF_CLONE_UNLOCK(ifc); 214 |
215 if_delgroup(ifp, ifc->ifc_name); 216 |
|
213 err = (*ifc->ifc_destroy)(ifc, ifp); 214 215 if (err != 0) { | 217 err = (*ifc->ifc_destroy)(ifc, ifp); 218 219 if (err != 0) { |
220 if_addgroup(ifp, ifc->ifc_name); 221 |
|
216 IF_CLONE_LOCK(ifc); 217 IFC_IFLIST_INSERT(ifc, ifp); 218 IF_CLONE_UNLOCK(ifc); 219 } 220 221done: 222 return (err); 223} --- 335 unchanged lines hidden --- | 222 IF_CLONE_LOCK(ifc); 223 IFC_IFLIST_INSERT(ifc, ifp); 224 IF_CLONE_UNLOCK(ifc); 225 } 226 227done: 228 return (err); 229} --- 335 unchanged lines hidden --- |