Deleted Added
full compact
udp_usrreq.c (107113) udp_usrreq.c (109623)
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
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 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
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 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
34 * $FreeBSD: head/sys/netinet/udp_usrreq.c 107113 2002-11-20 19:00:54Z luigi $
34 * $FreeBSD: head/sys/netinet/udp_usrreq.c 109623 2003-01-21 08:56:16Z alfred $
35 */
36
37#include "opt_ipsec.h"
38#include "opt_inet6.h"
39#include "opt_mac.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>

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

578 xig.xig_len = sizeof xig;
579 xig.xig_count = n;
580 xig.xig_gen = gencnt;
581 xig.xig_sogen = so_gencnt;
582 error = SYSCTL_OUT(req, &xig, sizeof xig);
583 if (error)
584 return error;
585
35 */
36
37#include "opt_ipsec.h"
38#include "opt_inet6.h"
39#include "opt_mac.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>

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

578 xig.xig_len = sizeof xig;
579 xig.xig_count = n;
580 xig.xig_gen = gencnt;
581 xig.xig_sogen = so_gencnt;
582 error = SYSCTL_OUT(req, &xig, sizeof xig);
583 if (error)
584 return error;
585
586 inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK);
586 inp_list = malloc(n * sizeof *inp_list, M_TEMP, 0);
587 if (inp_list == 0)
588 return ENOMEM;
589
590 s = splnet();
591 INP_INFO_RLOCK(&udbinfo);
592 for (inp = LIST_FIRST(udbinfo.listhead), i = 0; inp && i < n;
593 inp = LIST_NEXT(inp, inp_list)) {
594 INP_LOCK(inp);

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

796 error = ENOTCONN;
797 goto release;
798 }
799 }
800 /*
801 * Calculate data length and get a mbuf
802 * for UDP and IP headers.
803 */
587 if (inp_list == 0)
588 return ENOMEM;
589
590 s = splnet();
591 INP_INFO_RLOCK(&udbinfo);
592 for (inp = LIST_FIRST(udbinfo.listhead), i = 0; inp && i < n;
593 inp = LIST_NEXT(inp, inp_list)) {
594 INP_LOCK(inp);

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

796 error = ENOTCONN;
797 goto release;
798 }
799 }
800 /*
801 * Calculate data length and get a mbuf
802 * for UDP and IP headers.
803 */
804 M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT);
804 M_PREPEND(m, sizeof(struct udpiphdr), M_NOWAIT);
805 if (m == 0) {
806 error = ENOBUFS;
807 goto release;
808 }
809
810 /*
811 * Fill in mbuf with extended UDP header
812 * and addresses and length put into network format.

--- 273 unchanged lines hidden ---
805 if (m == 0) {
806 error = ENOBUFS;
807 goto release;
808 }
809
810 /*
811 * Fill in mbuf with extended UDP header
812 * and addresses and length put into network format.

--- 273 unchanged lines hidden ---