allows to simplify code used for both IPv4 and IPv6.
OK mikeb@ deraadt@
-/* $OpenBSD: if_etherip.c,v 1.16 2017/03/27 23:49:03 jca Exp $ */
+/* $OpenBSD: if_etherip.c,v 1.17 2017/04/14 20:46:31 bluhm Exp $ */
/*
* Copyright (c) 2015 Kazuya GODA <goda@openbsd.org>
*
}
int
-ip_etherip_input(struct mbuf **mp, int *offp, int proto)
+ip_etherip_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
* This is tricky but the path will be removed soon when
* implementation of etherip is removed from gif(4).
*/
- return etherip_input(mp, offp, proto);
+ return etherip_input(mp, offp, proto, af);
#else
etheripstat.etherips_noifdrops++;
m_freem(m);
}
int
-ip6_etherip_input(struct mbuf **mp, int *offp, int proto)
+ip6_etherip_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
* This is tricky but the path will be removed soon when
* implementation of etherip is removed from gif(4).
*/
- return etherip_input(mp, offp, proto);
+ return etherip_input(mp, offp, proto, af);
#else
etheripstat.etherips_noifdrops++;
m_freem(m);
int ip_etherip_sysctl(int *, uint, void *, size_t *, void *, size_t);
int ip_etherip_output(struct ifnet *, struct mbuf *);
-int ip_etherip_input(struct mbuf **, int *, int);
+int ip_etherip_input(struct mbuf **, int *, int, int);
#ifdef INET6
int ip6_etherip_output(struct ifnet *, struct mbuf *);
-int ip6_etherip_input(struct mbuf **, int *, int);
+int ip6_etherip_input(struct mbuf **, int *, int, int);
#endif /* INET6 */
-/* $OpenBSD: if_gif.c,v 1.91 2017/01/29 19:58:47 bluhm Exp $ */
+/* $OpenBSD: if_gif.c,v 1.92 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
}
int
-in_gif_input(struct mbuf **mp, int *offp, int proto)
+in_gif_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
struct gif_softc *sc;
inject:
/* No GIF interface was configured */
- return ip4_input(mp, offp, proto);
+ return ip4_input(mp, offp, proto, af);
}
#ifdef INET6
return 0;
}
-int in6_gif_input(struct mbuf **mp, int *offp, int proto)
+int in6_gif_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
struct gif_softc *sc;
inject:
/* No GIF tunnel configured */
- return ip4_input(mp, offp, proto);
+ return ip4_input(mp, offp, proto, af);
}
#endif /* INET6 */
-/* $OpenBSD: if_gif.h,v 1.16 2017/01/29 19:58:47 bluhm Exp $ */
+/* $OpenBSD: if_gif.h,v 1.17 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: if_gif.h,v 1.17 2000/09/11 11:36:41 sumikawa Exp $ */
/*
int gif_encap(struct ifnet *, struct mbuf **, sa_family_t);
-int in_gif_input(struct mbuf **, int *, int);
-int in6_gif_input(struct mbuf **, int *, int);
+int in_gif_input(struct mbuf **, int *, int, int);
+int in6_gif_input(struct mbuf **, int *, int, int);
#endif /* _NET_IF_GIF_H_ */
-/* $OpenBSD: if_pfsync.c,v 1.249 2017/04/11 14:43:49 dhill Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.250 2017/04/14 20:46:31 bluhm Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
}
int
-pfsync_input(struct mbuf **mp, int *offp, int proto)
+pfsync_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *n, *m = *mp;
struct pfsync_softc *sc = pfsyncif;
-/* $OpenBSD: if_pfsync.h,v 1.52 2017/02/20 06:30:39 jca Exp $ */
+/* $OpenBSD: if_pfsync.h,v 1.53 2017/04/14 20:46:31 bluhm Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
#define PFSYNC_S_DEFER 0xfe
#define PFSYNC_S_NONE 0xff
-int pfsync_input(struct mbuf **, int *, int);
+int pfsync_input(struct mbuf **, int *, int, int);
int pfsync_sysctl(int *, u_int, void *, size_t *,
void *, size_t);
-/* $OpenBSD: icmp6.h,v 1.43 2017/02/09 15:23:35 jca Exp $ */
+/* $OpenBSD: icmp6.h,v 1.44 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: icmp6.h,v 1.84 2003/04/23 10:26:51 itojun Exp $ */
/*
void icmp6_init(void);
void icmp6_paramerror(struct mbuf *, int);
void icmp6_error(struct mbuf *, int, int, int);
-int icmp6_input(struct mbuf **, int *, int);
+int icmp6_input(struct mbuf **, int *, int, int);
void icmp6_fasttimo(void);
void icmp6_reflect(struct mbuf *, size_t);
void icmp6_prepare(struct mbuf *);
-/* $OpenBSD: igmp.c,v 1.65 2017/04/05 13:35:18 deraadt Exp $ */
+/* $OpenBSD: igmp.c,v 1.66 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
void igmp_sendpkt(struct ifnet *, struct in_multi *, int, in_addr_t);
int rti_fill(struct in_multi *);
struct router_info * rti_find(struct ifnet *);
-int igmp_input_if(struct ifnet *, struct mbuf **, int *, int);
+int igmp_input_if(struct ifnet *, struct mbuf **, int *, int, int);
int igmp_sysctl_igmpstat(void *, size_t *, void *);
void
}
int
-igmp_input(struct mbuf **mp, int *offp, int proto)
+igmp_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct ifnet *ifp;
return IPPROTO_DONE;
}
- proto = igmp_input_if(ifp, mp, offp, proto);
+ proto = igmp_input_if(ifp, mp, offp, proto, af);
if_put(ifp);
return proto;
}
int
-igmp_input_if(struct ifnet *ifp, struct mbuf **mp, int *offp, int proto)
+igmp_input_if(struct ifnet *ifp, struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
int iphlen = *offp;
* Pass all valid IGMP packets up to any process(es) listening
* on a raw IGMP socket.
*/
- return rip_input(mp, offp, proto);
+ return rip_input(mp, offp, proto, af);
}
void
-/* $OpenBSD: igmp_var.h,v 1.12 2017/01/29 19:58:47 bluhm Exp $ */
+/* $OpenBSD: igmp_var.h,v 1.13 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: igmp_var.h,v 1.9 1996/02/13 23:41:31 christos Exp $ */
/*
#define IGMP_RANDOM_DELAY(X) (arc4random_uniform(X) + 1)
void igmp_init(void);
-int igmp_input(struct mbuf **, int *, int);
+int igmp_input(struct mbuf **, int *, int, int);
void igmp_joingroup(struct in_multi *);
void igmp_leavegroup(struct in_multi *);
void igmp_fasttimo(void);
-/* $OpenBSD: ip_carp.c,v 1.307 2017/04/11 14:43:49 dhill Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.308 2017/04/14 20:46:31 bluhm Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
}
int
-carp_proto_input(struct mbuf **mp, int *offp, int proto)
+carp_proto_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct ifnet *ifp;
#ifdef INET6
int
-carp6_proto_input(struct mbuf **mp, int *offp, int proto)
+carp6_proto_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct ifnet *ifp;
-/* $OpenBSD: ip_carp.h,v 1.41 2017/02/20 06:29:42 jca Exp $ */
+/* $OpenBSD: ip_carp.h,v 1.42 2017/04/14 20:46:31 bluhm Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
}
void carp_ifdetach (struct ifnet *);
-int carp_proto_input(struct mbuf **, int *, int);
+int carp_proto_input(struct mbuf **, int *, int, int);
void carp_carpdev_state(void *);
void carp_group_demote_adj(struct ifnet *, int, char *);
-int carp6_proto_input(struct mbuf **, int *, int);
+int carp6_proto_input(struct mbuf **, int *, int, int);
int carp_iamatch(struct ifnet *);
int carp_iamatch6(struct ifnet *);
struct ifnet *carp_ourether(void *, u_int8_t *);
-/* $OpenBSD: ip_divert.h,v 1.9 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: ip_divert.h,v 1.10 2017/04/14 20:46:31 bluhm Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
extern struct inpcbtable divbtable;
void divert_init(void);
-void divert_input(struct mbuf *, int, int);
int divert_packet(struct mbuf *, int, u_int16_t);
int divert_sysctl(int *, u_int, void *, size_t *, void *, size_t);
int divert_usrreq(struct socket *,
-/* $OpenBSD: ip_ether.c,v 1.84 2017/03/07 23:35:06 jca Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.85 2017/04/14 20:46:31 bluhm Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
*
* etherip_input gets called when we receive an encapsulated packet.
*/
int
-etherip_input(struct mbuf **mp, int *offp, int proto)
+etherip_input(struct mbuf **mp, int *offp, int proto, int af)
{
switch (proto) {
#if NBRIDGE > 0
-/* $OpenBSD: ip_ether.h,v 1.21 2017/03/07 23:35:06 jca Exp $ */
+/* $OpenBSD: ip_ether.h,v 1.22 2017/04/14 20:46:31 bluhm Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@adk.gr)
*
struct tdb;
int etherip_output(struct mbuf *, struct tdb *, struct mbuf **, int);
-int etherip_input(struct mbuf **, int *, int);
+int etherip_input(struct mbuf **, int *, int, int);
int etherip_sysctl(int *, u_int, void *, size_t *, void *, size_t);
extern int etherip_allow;
-/* $OpenBSD: ip_gre.c,v 1.62 2017/01/29 19:58:47 bluhm Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.63 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
* IPPROTO_GRE and a local destination address).
*/
int
-gre_input(struct mbuf **mp, int *offp, int proto)
+gre_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
int hlen = *offp;
* but we're not set to accept them.
*/
if (!ret)
- return rip_input(mp, offp, proto);
+ return rip_input(mp, offp, proto, af);
return IPPROTO_DONE;
}
*/
int
-gre_mobile_input(struct mbuf **mp, int *offp, int proto)
+gre_mobile_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
struct ip *ip;
-/* $OpenBSD: ip_gre.h,v 1.11 2017/01/29 19:58:47 bluhm Exp $ */
+/* $OpenBSD: ip_gre.h,v 1.12 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: ip_gre.h,v 1.3 1998/10/07 23:33:02 thorpej Exp $ */
/*
}
#ifdef _KERNEL
-int gre_input(struct mbuf **, int *, int);
-int gre_mobile_input(struct mbuf **, int *, int);
+int gre_input(struct mbuf **, int *, int, int);
+int gre_mobile_input(struct mbuf **, int *, int, int);
int ipmobile_sysctl(int *, u_int, void *, size_t *, void *, size_t);
int gre_sysctl(int *, u_int, void *, size_t *, void *, size_t);
int gre_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *);
-/* $OpenBSD: ip_icmp.c,v 1.164 2017/04/05 13:35:18 deraadt Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.165 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
void icmp_mtudisc_timeout(struct rtentry *, struct rttimer *);
int icmp_ratelimit(const struct in_addr *, const int, const int);
void icmp_redirect_timeout(struct rtentry *, struct rttimer *);
-int icmp_input_if(struct ifnet *, struct mbuf **, int *, int);
+int icmp_input_if(struct ifnet *, struct mbuf **, int *, int, int);
int icmp_sysctl_icmpstat(void *, size_t *, void *);
void
* Process a received ICMP message.
*/
int
-icmp_input(struct mbuf **mp, int *offp, int proto)
+icmp_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct ifnet *ifp;
return IPPROTO_DONE;
}
- proto = icmp_input_if(ifp, mp, offp, proto);
+ proto = icmp_input_if(ifp, mp, offp, proto, af);
if_put(ifp);
return proto;
}
int
-icmp_input_if(struct ifnet *ifp, struct mbuf **mp, int *offp, int proto)
+icmp_input_if(struct ifnet *ifp, struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
int hlen = *offp;
}
raw:
- return rip_input(mp, offp, proto);
+ return rip_input(mp, offp, proto, af);
freeit:
m_freem(m);
-/* $OpenBSD: ip_icmp.h,v 1.29 2017/01/29 19:58:47 bluhm Exp $ */
+/* $OpenBSD: ip_icmp.h,v 1.30 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: ip_icmp.h,v 1.10 1996/02/13 23:42:28 christos Exp $ */
/*
struct mbuf *
icmp_do_error(struct mbuf *, int, int, u_int32_t, int);
void icmp_error(struct mbuf *, int, int, u_int32_t, int);
-int icmp_input(struct mbuf **, int *, int);
+int icmp_input(struct mbuf **, int *, int, int);
void icmp_init(void);
int icmp_reflect(struct mbuf *, struct mbuf **, struct in_ifaddr *);
void icmp_send(struct mbuf *, struct mbuf *);
-/* $OpenBSD: ip_input.c,v 1.296 2017/04/05 13:35:18 deraadt Exp $ */
+/* $OpenBSD: ip_input.c,v 1.297 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
* Switch out to protocol's input routine.
*/
ipstat_inc(ips_delivered);
- (*inetsw[ip_protox[ip->ip_p]].pr_input)(&m, &hlen, ip->ip_p);
+ (*inetsw[ip_protox[ip->ip_p]].pr_input)(&m, &hlen, ip->ip_p, AF_INET);
return;
bad:
m_freem(m);
-/* $OpenBSD: ip_ipip.c,v 1.73 2017/04/05 13:35:18 deraadt Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.74 2017/04/14 20:46:31 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
* Really only a wrapper for ipip_input(), for use with pr_input.
*/
int
-ip4_input(struct mbuf **mp, int *offp, int proto)
+ip4_input(struct mbuf **mp, int *offp, int proto, int af)
{
/* If we do not accept IP-in-IP explicitly, drop. */
if (!ipip_allow && ((*mp)->m_flags & (M_AUTH|M_CONF)) == 0) {
-/* $OpenBSD: ip_ipsp.h,v 1.178 2017/02/07 22:28:37 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.179 2017/04/14 20:46:31 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
int ipip_input(struct mbuf **, int *, struct ifnet *, int);
int ipip_output(struct mbuf *, struct tdb *, struct mbuf **, int, int);
-int ip4_input(struct mbuf **, int *, int);
+int ip4_input(struct mbuf **, int *, int, int);
/* XF_AH */
int ah_attach(void);
int ah_output(struct mbuf *, struct tdb *, struct mbuf **, int, int);
int ah_sysctl(int *, u_int, void *, size_t *, void *, size_t);
-int ah4_input(struct mbuf **, int *, int);
+int ah4_input(struct mbuf **, int *, int, int);
void ah4_ctlinput(int, struct sockaddr *, u_int, void *);
void udpencap_ctlinput(int, struct sockaddr *, u_int, void *);
#ifdef INET6
-int ah6_input(struct mbuf **, int *, int);
+int ah6_input(struct mbuf **, int *, int, int);
#endif /* INET6 */
/* XF_ESP */
int esp_output(struct mbuf *, struct tdb *, struct mbuf **, int, int);
int esp_sysctl(int *, u_int, void *, size_t *, void *, size_t);
-int esp4_input(struct mbuf **, int *, int);
+int esp4_input(struct mbuf **, int *, int, int);
void esp4_ctlinput(int, struct sockaddr *, u_int, void *);
#ifdef INET6
-int esp6_input(struct mbuf **, int *, int);
+int esp6_input(struct mbuf **, int *, int, int);
#endif /* INET6 */
/* XF_IPCOMP */
int ipcomp_input(struct mbuf *, struct tdb *, int, int);
int ipcomp_output(struct mbuf *, struct tdb *, struct mbuf **, int, int);
int ipcomp_sysctl(int *, u_int, void *, size_t *, void *, size_t);
-int ipcomp4_input(struct mbuf **, int *, int);
+int ipcomp4_input(struct mbuf **, int *, int, int);
#ifdef INET6
-int ipcomp6_input(struct mbuf **, int *, int);
+int ipcomp6_input(struct mbuf **, int *, int, int);
#endif /* INET6 */
/* XF_TCPSIGNATURE */
-/* $OpenBSD: ip_var.h,v 1.70 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: ip_var.h,v 1.71 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */
/*
void ip_forward(struct mbuf *, struct ifnet *, struct rtentry *, int);
int rip_ctloutput(int, struct socket *, int, int, struct mbuf *);
void rip_init(void);
-int rip_input(struct mbuf **, int *, int);
+int rip_input(struct mbuf **, int *, int, int);
int rip_output(struct mbuf *, struct socket *, struct sockaddr *,
struct mbuf *);
int rip_usrreq(struct socket *,
-/* $OpenBSD: ipsec_input.c,v 1.146 2017/04/06 14:25:18 dhill Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.147 2017/04/14 20:46:31 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
(sproto == IPPROTO_IPCOMP && !ipcomp_enable)) {
switch (af) {
case AF_INET:
- rip_input(&m, &skip, sproto);
+ rip_input(&m, &skip, sproto, af);
break;
#ifdef INET6
case AF_INET6:
- rip6_input(&m, &skip, sproto);
+ rip6_input(&m, &skip, sproto, af);
break;
#endif /* INET6 */
default:
/* IPv4 AH wrapper. */
int
-ah4_input(struct mbuf **mp, int *offp, int proto)
+ah4_input(struct mbuf **mp, int *offp, int proto, int af)
{
ipsec_common_input(*mp, *offp, offsetof(struct ip, ip_p), AF_INET,
proto, 0);
/* IPv4 ESP wrapper. */
int
-esp4_input(struct mbuf **mp, int *offp, int proto)
+esp4_input(struct mbuf **mp, int *offp, int proto, int af)
{
ipsec_common_input(*mp, *offp, offsetof(struct ip, ip_p), AF_INET,
proto, 0);
/* IPv4 IPCOMP wrapper */
int
-ipcomp4_input(struct mbuf **mp, int *offp, int proto)
+ipcomp4_input(struct mbuf **mp, int *offp, int proto, int af)
{
ipsec_common_input(*mp, *offp, offsetof(struct ip, ip_p), AF_INET,
proto, 0);
#ifdef INET6
/* IPv6 AH wrapper. */
int
-ah6_input(struct mbuf **mp, int *offp, int proto)
+ah6_input(struct mbuf **mp, int *offp, int proto, int af)
{
int l = 0;
int protoff, nxt;
/* IPv6 ESP wrapper. */
int
-esp6_input(struct mbuf **mp, int *offp, int proto)
+esp6_input(struct mbuf **mp, int *offp, int proto, int af)
{
int l = 0;
int protoff, nxt;
/* IPv6 IPcomp wrapper */
int
-ipcomp6_input(struct mbuf **mp, int *offp, int proto)
+ipcomp6_input(struct mbuf **mp, int *offp, int proto, int af)
{
int l = 0;
int protoff, nxt;
-/* $OpenBSD: raw_ip.c,v 1.97 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.98 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET };
int
-rip_input(struct mbuf **mp, int *offp, int proto)
+rip_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
struct ip *ip = mtod(m, struct ip *);
-/* $OpenBSD: tcp_input.c,v 1.338 2017/02/09 15:19:32 jca Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.339 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
* protocol specification dated September, 1981 very closely.
*/
int
-tcp_input(struct mbuf **mp, int *offp, int proto)
+tcp_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
int iphlen = *offp;
struct tdb *tdb;
int error;
#endif /* IPSEC */
- int af;
#ifdef TCP_ECN
u_char iptos;
#endif
-/* $OpenBSD: tcp_var.h,v 1.123 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.124 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
int tcp_dooptions(struct tcpcb *, u_char *, int, struct tcphdr *,
struct mbuf *, int, struct tcp_opt_info *, u_int);
void tcp_init(void);
-int tcp_input(struct mbuf **, int *, int);
+int tcp_input(struct mbuf **, int *, int, int);
int tcp_mss(struct tcpcb *, int);
void tcp_mss_update(struct tcpcb *);
u_int tcp_hdrsz(struct tcpcb *);
-/* $OpenBSD: udp_usrreq.c,v 1.233 2017/04/05 13:35:18 deraadt Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.234 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
}
int
-udp_input(struct mbuf **mp, int *offp, int proto)
+udp_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
int iphlen = *offp;
-/* $OpenBSD: udp_var.h,v 1.32 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: udp_var.h,v 1.33 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: udp_var.h,v 1.12 1996/02/13 23:44:41 christos Exp $ */
/*
#endif /* INET6 */
void udp_ctlinput(int, struct sockaddr *, u_int, void *);
void udp_init(void);
-int udp_input(struct mbuf **, int *, int);
+int udp_input(struct mbuf **, int *, int, int);
#ifdef INET6
int udp6_output(struct inpcb *, struct mbuf *, struct mbuf *,
struct mbuf *);
-/* $OpenBSD: dest6.c,v 1.16 2017/02/05 16:04:14 jca Exp $ */
+/* $OpenBSD: dest6.c,v 1.17 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: dest6.c,v 1.25 2001/02/22 01:39:16 itojun Exp $ */
/*
* Destination options header processing.
*/
int
-dest6_input(struct mbuf **mp, int *offp, int proto)
+dest6_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
int off = *offp, dstoptlen, optlen;
-/* $OpenBSD: frag6.c,v 1.72 2017/02/05 16:04:14 jca Exp $ */
+/* $OpenBSD: frag6.c,v 1.73 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */
/*
* Fragment input
*/
int
-frag6_input(struct mbuf **mp, int *offp, int proto)
+frag6_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp, *t;
struct ip6_hdr *ip6;
-/* $OpenBSD: icmp6.c,v 1.204 2017/04/05 13:35:18 deraadt Exp $ */
+/* $OpenBSD: icmp6.c,v 1.205 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
* Process a received ICMP6 message.
*/
int
-icmp6_input(struct mbuf **mp, int *offp, int proto)
+icmp6_input(struct mbuf **mp, int *offp, int proto, int af)
{
#if NCARP > 0
struct ifnet *ifp;
-/* $OpenBSD: ip6_divert.h,v 1.7 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: ip6_divert.h,v 1.8 2017/04/14 20:46:31 bluhm Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
extern struct inpcbtable divb6table;
void divert6_init(void);
-int divert6_input(struct mbuf **, int *, int);
int divert6_packet(struct mbuf *, int, u_int16_t);
int divert6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
int divert6_usrreq(struct socket *,
-/* $OpenBSD: ip6_input.c,v 1.182 2017/04/06 02:11:08 dhill Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.183 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
goto bad;
}
- nxt = (*inet6sw[ip6_protox[nxt]].pr_input)(&m, &off, nxt);
+ nxt = (*inet6sw[ip6_protox[nxt]].pr_input)(&m, &off, nxt,
+ AF_INET6);
}
return;
bad:
-/* $OpenBSD: ip6_var.h,v 1.71 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: ip6_var.h,v 1.72 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
/*
u_int32_t ip6_randomid(void);
void ip6_send(struct mbuf *);
-int route6_input(struct mbuf **, int *, int);
+int route6_input(struct mbuf **, int *, int, int);
void frag6_init(void);
-int frag6_input(struct mbuf **, int *, int);
+int frag6_input(struct mbuf **, int *, int, int);
int frag6_deletefraghdr(struct mbuf *, int);
void frag6_slowtimo(void);
void frag6_drain(void);
void rip6_init(void);
-int rip6_input(struct mbuf **mp, int *offp, int proto);
+int rip6_input(struct mbuf **, int *, int, int);
void rip6_ctlinput(int, struct sockaddr *, u_int, void *);
int rip6_ctloutput(int, struct socket *, int, int, struct mbuf *);
int rip6_output(struct mbuf *, struct socket *, struct sockaddr *,
int rip6_attach(struct socket *, int);
int rip6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
-int dest6_input(struct mbuf **, int *, int);
+int dest6_input(struct mbuf **, int *, int, int);
int none_input(struct mbuf **, int *, int);
int in6_pcbselsrc(struct in6_addr **, struct sockaddr_in6 *,
-/* $OpenBSD: raw_ip6.c,v 1.108 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.109 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
}
int
-rip6_input(struct mbuf **mp, int *offp, int proto)
+rip6_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct mbuf *m = *mp;
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
-/* $OpenBSD: route6.c,v 1.20 2017/02/05 16:04:14 jca Exp $ */
+/* $OpenBSD: route6.c,v 1.21 2017/04/14 20:46:31 bluhm Exp $ */
/* $KAME: route6.c,v 1.22 2000/12/03 00:54:00 itojun Exp $ */
/*
*/
int
-route6_input(struct mbuf **mp, int *offp, int proto)
+route6_input(struct mbuf **mp, int *offp, int proto, int af)
{
struct ip6_hdr *ip6;
struct mbuf *m = *mp;
-/* $OpenBSD: protosw.h,v 1.24 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: protosw.h,v 1.25 2017/04/14 20:46:31 bluhm Exp $ */
/* $NetBSD: protosw.h,v 1.10 1996/04/09 20:55:32 cgd Exp $ */
/*-
/* protocol-protocol hooks */
/* input to protocol (from below) */
- int (*pr_input)(struct mbuf **, int *, int);
+ int (*pr_input)(struct mbuf **, int *, int, int);
/* output to protocol (from above) */
int (*pr_output)(struct mbuf *, struct socket *, struct sockaddr *,
struct mbuf *);