Deleted Added
full compact
in.c (108033) in.c (109623)
1/*
2 * Copyright (c) 1982, 1986, 1991, 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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in.c 8.4 (Berkeley) 1/9/95
1/*
2 * Copyright (c) 1982, 1986, 1991, 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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in.c 8.4 (Berkeley) 1/9/95
34 * $FreeBSD: head/sys/netinet/in.c 108033 2002-12-18 11:46:59Z hsu $
34 * $FreeBSD: head/sys/netinet/in.c 109623 2003-01-21 08:56:16Z alfred $
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/sockio.h>
40#include <sys/malloc.h>
41#include <sys/socket.h>
42#include <sys/kernel.h>

--- 220 unchanged lines hidden (view full) ---

263 case SIOCSIFDSTADDR:
264 if (td && (error = suser(td)) != 0)
265 return error;
266
267 if (ifp == 0)
268 return (EADDRNOTAVAIL);
269 if (ia == (struct in_ifaddr *)0) {
270 ia = (struct in_ifaddr *)
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/sockio.h>
40#include <sys/malloc.h>
41#include <sys/socket.h>
42#include <sys/kernel.h>

--- 220 unchanged lines hidden (view full) ---

263 case SIOCSIFDSTADDR:
264 if (td && (error = suser(td)) != 0)
265 return error;
266
267 if (ifp == 0)
268 return (EADDRNOTAVAIL);
269 if (ia == (struct in_ifaddr *)0) {
270 ia = (struct in_ifaddr *)
271 malloc(sizeof *ia, M_IFADDR, M_WAITOK | M_ZERO);
271 malloc(sizeof *ia, M_IFADDR, M_ZERO);
272 if (ia == (struct in_ifaddr *)NULL)
273 return (ENOBUFS);
274 /*
275 * Protect from ipintr() traversing address list
276 * while we're modifying it.
277 */
278 s = splnet();
279 TAILQ_INSERT_TAIL(&in_ifaddrhead, ia, ia_link);

--- 552 unchanged lines hidden (view full) ---

832 * If ifma->ifma_protospec is null, then if_addmulti() created
833 * a new record. Otherwise, we are done.
834 */
835 if (ifma->ifma_protospec != 0) {
836 splx(s);
837 return ifma->ifma_protospec;
838 }
839
272 if (ia == (struct in_ifaddr *)NULL)
273 return (ENOBUFS);
274 /*
275 * Protect from ipintr() traversing address list
276 * while we're modifying it.
277 */
278 s = splnet();
279 TAILQ_INSERT_TAIL(&in_ifaddrhead, ia, ia_link);

--- 552 unchanged lines hidden (view full) ---

832 * If ifma->ifma_protospec is null, then if_addmulti() created
833 * a new record. Otherwise, we are done.
834 */
835 if (ifma->ifma_protospec != 0) {
836 splx(s);
837 return ifma->ifma_protospec;
838 }
839
840 /* XXX - if_addmulti uses M_WAITOK. Can this really be called
840 /* XXX - if_addmulti does not use N_NOWAIT. Can this really be called
841 at interrupt time? If so, need to fix if_addmulti. XXX */
842 inm = (struct in_multi *)malloc(sizeof(*inm), M_IPMADDR,
843 M_NOWAIT | M_ZERO);
844 if (inm == NULL) {
845 splx(s);
846 return (NULL);
847 }
848

--- 44 unchanged lines hidden ---
841 at interrupt time? If so, need to fix if_addmulti. XXX */
842 inm = (struct in_multi *)malloc(sizeof(*inm), M_IPMADDR,
843 M_NOWAIT | M_ZERO);
844 if (inm == NULL) {
845 splx(s);
846 return (NULL);
847 }
848

--- 44 unchanged lines hidden ---