Wed Jan 20 22:01:18 2016 UTC ()
Give proper prototype to udp_output.


(riastradh)
diff -r1.222 -r1.223 src/sys/netinet/udp_usrreq.c
diff -r1.40 -r1.41 src/sys/netinet/udp_var.h

cvs diff -r1.222 -r1.223 src/sys/netinet/udp_usrreq.c (expand / switch to unified diff)

--- src/sys/netinet/udp_usrreq.c 2015/08/24 22:21:26 1.222
+++ src/sys/netinet/udp_usrreq.c 2016/01/20 22:01:18 1.223
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: udp_usrreq.c,v 1.222 2015/08/24 22:21:26 pooka Exp $ */ 1/* $NetBSD: udp_usrreq.c,v 1.223 2016/01/20 22:01:18 riastradh Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -56,27 +56,27 @@ @@ -56,27 +56,27 @@
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 * 59 *
60 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 60 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
61 */ 61 */
62 62
63/* 63/*
64 * UDP protocol implementation. 64 * UDP protocol implementation.
65 * Per RFC 768, August, 1980. 65 * Per RFC 768, August, 1980.
66 */ 66 */
67 67
68#include <sys/cdefs.h> 68#include <sys/cdefs.h>
69__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.222 2015/08/24 22:21:26 pooka Exp $"); 69__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.223 2016/01/20 22:01:18 riastradh Exp $");
70 70
71#ifdef _KERNEL_OPT 71#ifdef _KERNEL_OPT
72#include "opt_inet.h" 72#include "opt_inet.h"
73#include "opt_compat_netbsd.h" 73#include "opt_compat_netbsd.h"
74#include "opt_ipsec.h" 74#include "opt_ipsec.h"
75#include "opt_inet_csum.h" 75#include "opt_inet_csum.h"
76#include "opt_ipkdb.h" 76#include "opt_ipkdb.h"
77#include "opt_mbuftrace.h" 77#include "opt_mbuftrace.h"
78#endif 78#endif
79 79
80#include <sys/param.h> 80#include <sys/param.h>
81#include <sys/mbuf.h> 81#include <sys/mbuf.h>
82#include <sys/once.h> 82#include <sys/once.h>
@@ -765,39 +765,34 @@ udp_ctloutput(int op, struct socket *so, @@ -765,39 +765,34 @@ udp_ctloutput(int op, struct socket *so,
765 765
766 default: 766 default:
767 error = EINVAL; 767 error = EINVAL;
768 break; 768 break;
769 } 769 }
770 770
771end: 771end:
772 splx(s); 772 splx(s);
773 return error; 773 return error;
774} 774}
775 775
776 776
777int 777int
778udp_output(struct mbuf *m, ...) 778udp_output(struct mbuf *m, struct inpcb *inp)
779{ 779{
780 struct inpcb *inp; 
781 struct udpiphdr *ui; 780 struct udpiphdr *ui;
782 struct route *ro; 781 struct route *ro;
783 int len = m->m_pkthdr.len; 782 int len = m->m_pkthdr.len;
784 int error = 0; 783 int error = 0;
785 va_list ap; 
786 784
787 MCLAIM(m, &udp_tx_mowner); 785 MCLAIM(m, &udp_tx_mowner);
788 va_start(ap, m); 
789 inp = va_arg(ap, struct inpcb *); 
790 va_end(ap); 
791 786
792 /* 787 /*
793 * Calculate data length and get a mbuf 788 * Calculate data length and get a mbuf
794 * for UDP and IP headers. 789 * for UDP and IP headers.
795 */ 790 */
796 M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT); 791 M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT);
797 if (m == 0) { 792 if (m == 0) {
798 error = ENOBUFS; 793 error = ENOBUFS;
799 goto release; 794 goto release;
800 } 795 }
801 796
802 /* 797 /*
803 * Compute the packet length of the IP header, and 798 * Compute the packet length of the IP header, and

cvs diff -r1.40 -r1.41 src/sys/netinet/udp_var.h (expand / switch to unified diff)

--- src/sys/netinet/udp_var.h 2014/05/18 14:46:16 1.40
+++ src/sys/netinet/udp_var.h 2016/01/20 22:01:18 1.41
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: udp_var.h,v 1.40 2014/05/18 14:46:16 rmind Exp $ */ 1/* $NetBSD: udp_var.h,v 1.41 2016/01/20 22:01:18 riastradh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1986, 1989, 1993 4 * Copyright (c) 1982, 1986, 1989, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -86,22 +86,22 @@ struct udpiphdr { @@ -86,22 +86,22 @@ struct udpiphdr {
86 { "stats", CTLTYPE_STRUCT }, \ 86 { "stats", CTLTYPE_STRUCT }, \
87} 87}
88 88
89#ifdef _KERNEL 89#ifdef _KERNEL
90 90
91extern struct inpcbtable udbtable; 91extern struct inpcbtable udbtable;
92extern const struct pr_usrreqs udp_usrreqs; 92extern const struct pr_usrreqs udp_usrreqs;
93 93
94void *udp_ctlinput(int, const struct sockaddr *, void *); 94void *udp_ctlinput(int, const struct sockaddr *, void *);
95int udp_ctloutput(int, struct socket *, struct sockopt *); 95int udp_ctloutput(int, struct socket *, struct sockopt *);
96void udp_init(void); 96void udp_init(void);
97void udp_init_common(void); 97void udp_init_common(void);
98void udp_input(struct mbuf *, ...); 98void udp_input(struct mbuf *, ...);
99int udp_output(struct mbuf *, ...); 99int udp_output(struct mbuf *, struct inpcb *);
100int udp_sysctl(int *, u_int, void *, size_t *, void *, size_t); 100int udp_sysctl(int *, u_int, void *, size_t *, void *, size_t);
101 101
102int udp_input_checksum(int af, struct mbuf *, const struct udphdr *, int, 102int udp_input_checksum(int af, struct mbuf *, const struct udphdr *, int,
103 int); 103 int);
104void udp_statinc(u_int); 104void udp_statinc(u_int);
105#endif /* _KERNEL */ 105#endif /* _KERNEL */
106 106
107#endif /* !_NETINET_UDP_VAR_H_ */ 107#endif /* !_NETINET_UDP_VAR_H_ */