Give proper prototype to rip_output.diff -r1.108 -r1.109 src/sys/netinet/ip_var.h
(riastradh)
--- src/sys/netinet/ip_var.h 2015/06/04 09:20:00 1.108
+++ src/sys/netinet/ip_var.h 2016/01/20 22:02:54 1.109
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ip_var.h,v 1.108 2015/06/04 09:20:00 ozaki-r Exp $ */ | 1 | /* $NetBSD: ip_var.h,v 1.109 2016/01/20 22:02:54 riastradh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1982, 1986, 1993 | 4 | * Copyright (c) 1982, 1986, 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. | |
@@ -220,27 +220,27 @@ void ip_reass_drain(void); | @@ -220,27 +220,27 @@ void ip_reass_drain(void); | |||
220 | 220 | |||
221 | void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *, | 221 | void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *, | |
222 | struct mbuf *); | 222 | struct mbuf *); | |
223 | void ip_slowtimo(void); | 223 | void ip_slowtimo(void); | |
224 | void ip_fasttimo(void); | 224 | void ip_fasttimo(void); | |
225 | struct mbuf * | 225 | struct mbuf * | |
226 | ip_srcroute(void); | 226 | ip_srcroute(void); | |
227 | int ip_sysctl(int *, u_int, void *, size_t *, void *, size_t); | 227 | int ip_sysctl(int *, u_int, void *, size_t *, void *, size_t); | |
228 | void ip_statinc(u_int); | 228 | void ip_statinc(u_int); | |
229 | void * rip_ctlinput(int, const struct sockaddr *, void *); | 229 | void * rip_ctlinput(int, const struct sockaddr *, void *); | |
230 | int rip_ctloutput(int, struct socket *, struct sockopt *); | 230 | int rip_ctloutput(int, struct socket *, struct sockopt *); | |
231 | void rip_init(void); | 231 | void rip_init(void); | |
232 | void rip_input(struct mbuf *, ...); | 232 | void rip_input(struct mbuf *, ...); | |
233 | int rip_output(struct mbuf *, ...); | 233 | int rip_output(struct mbuf *, struct inpcb *); | |
234 | int rip_usrreq(struct socket *, | 234 | int rip_usrreq(struct socket *, | |
235 | int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *); | 235 | int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *); | |
236 | 236 | |||
237 | int ip_setmoptions(struct ip_moptions **, const struct sockopt *sopt); | 237 | int ip_setmoptions(struct ip_moptions **, const struct sockopt *sopt); | |
238 | int ip_getmoptions(struct ip_moptions *, struct sockopt *sopt); | 238 | int ip_getmoptions(struct ip_moptions *, struct sockopt *sopt); | |
239 | 239 | |||
240 | int ip_hresolv_output(struct ifnet * const, struct mbuf * const, | 240 | int ip_hresolv_output(struct ifnet * const, struct mbuf * const, | |
241 | const struct sockaddr * const, struct rtentry *); | 241 | const struct sockaddr * const, struct rtentry *); | |
242 | 242 | |||
243 | /* IP Flow interface. */ | 243 | /* IP Flow interface. */ | |
244 | void ipflow_init(void); | 244 | void ipflow_init(void); | |
245 | void ipflow_poolinit(void); | 245 | void ipflow_poolinit(void); | |
246 | struct ipflow *ipflow_reap(bool); | 246 | struct ipflow *ipflow_reap(bool); |
--- src/sys/netinet/raw_ip.c 2015/08/24 22:21:26 1.153
+++ src/sys/netinet/raw_ip.c 2016/01/20 22:02:54 1.154
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: raw_ip.c,v 1.153 2015/08/24 22:21:26 pooka Exp $ */ | 1 | /* $NetBSD: raw_ip.c,v 1.154 2016/01/20 22:02:54 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. | |
@@ -55,27 +55,27 @@ | @@ -55,27 +55,27 @@ | |||
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
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 | * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 | 60 | * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 | |
61 | */ | 61 | */ | |
62 | 62 | |||
63 | /* | 63 | /* | |
64 | * Raw interface to IP protocol. | 64 | * Raw interface to IP protocol. | |
65 | */ | 65 | */ | |
66 | 66 | |||
67 | #include <sys/cdefs.h> | 67 | #include <sys/cdefs.h> | |
68 | __KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.153 2015/08/24 22:21:26 pooka Exp $"); | 68 | __KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.154 2016/01/20 22:02:54 riastradh Exp $"); | |
69 | 69 | |||
70 | #ifdef _KERNEL_OPT | 70 | #ifdef _KERNEL_OPT | |
71 | #include "opt_inet.h" | 71 | #include "opt_inet.h" | |
72 | #include "opt_compat_netbsd.h" | 72 | #include "opt_compat_netbsd.h" | |
73 | #include "opt_ipsec.h" | 73 | #include "opt_ipsec.h" | |
74 | #include "opt_mrouting.h" | 74 | #include "opt_mrouting.h" | |
75 | #endif | 75 | #endif | |
76 | 76 | |||
77 | #include <sys/param.h> | 77 | #include <sys/param.h> | |
78 | #include <sys/sysctl.h> | 78 | #include <sys/sysctl.h> | |
79 | #include <sys/mbuf.h> | 79 | #include <sys/mbuf.h> | |
80 | #include <sys/socket.h> | 80 | #include <sys/socket.h> | |
81 | #include <sys/protosw.h> | 81 | #include <sys/protosw.h> | |
@@ -301,37 +301,31 @@ rip_ctlinput(int cmd, const struct socka | @@ -301,37 +301,31 @@ rip_ctlinput(int cmd, const struct socka | |||
301 | 301 | |||
302 | /* XXX mapped address case */ | 302 | /* XXX mapped address case */ | |
303 | } else | 303 | } else | |
304 | in_pcbnotifyall(&rawcbtable, satocsin(sa)->sin_addr, errno, | 304 | in_pcbnotifyall(&rawcbtable, satocsin(sa)->sin_addr, errno, | |
305 | notify); | 305 | notify); | |
306 | return NULL; | 306 | return NULL; | |
307 | } | 307 | } | |
308 | 308 | |||
309 | /* | 309 | /* | |
310 | * Generate IP header and pass packet to ip_output. | 310 | * Generate IP header and pass packet to ip_output. | |
311 | * Tack on options user may have setup with control call. | 311 | * Tack on options user may have setup with control call. | |
312 | */ | 312 | */ | |
313 | int | 313 | int | |
314 | rip_output(struct mbuf *m, ...) | 314 | rip_output(struct mbuf *m, struct inpcb *inp) | |
315 | { | 315 | { | |
316 | struct inpcb *inp; | |||
317 | struct ip *ip; | 316 | struct ip *ip; | |
318 | struct mbuf *opts; | 317 | struct mbuf *opts; | |
319 | int flags; | 318 | int flags; | |
320 | va_list ap; | |||
321 | ||||
322 | va_start(ap, m); | |||
323 | inp = va_arg(ap, struct inpcb *); | |||
324 | va_end(ap); | |||
325 | 319 | |||
326 | flags = | 320 | flags = | |
327 | (inp->inp_socket->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST | 321 | (inp->inp_socket->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST | |
328 | | IP_RETURNMTU; | 322 | | IP_RETURNMTU; | |
329 | 323 | |||
330 | /* | 324 | /* | |
331 | * If the user handed us a complete IP packet, use it. | 325 | * If the user handed us a complete IP packet, use it. | |
332 | * Otherwise, allocate an mbuf for a header and fill it in. | 326 | * Otherwise, allocate an mbuf for a header and fill it in. | |
333 | */ | 327 | */ | |
334 | if ((inp->inp_flags & INP_HDRINCL) == 0) { | 328 | if ((inp->inp_flags & INP_HDRINCL) == 0) { | |
335 | if ((m->m_pkthdr.len + sizeof(struct ip)) > IP_MAXPACKET) { | 329 | if ((m->m_pkthdr.len + sizeof(struct ip)) > IP_MAXPACKET) { | |
336 | m_freem(m); | 330 | m_freem(m); | |
337 | return (EMSGSIZE); | 331 | return (EMSGSIZE); |