-/* $OpenBSD: ip_input.c,v 1.310 2017/05/31 05:59:09 mpi Exp $ */
+/* $OpenBSD: ip_input.c,v 1.311 2017/06/19 17:00:16 bluhm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
#ifdef MROUTING
if (ipmforwarding && ip_mrouter[ifp->if_rdomain]) {
- int rv;
+ int error;
if (m->m_flags & M_EXT) {
if ((m = m_pullup(m, hlen)) == NULL) {
* ip_output().)
*/
KERNEL_LOCK();
- rv = ip_mforward(m, ifp);
+ error = ip_mforward(m, ifp);
KERNEL_UNLOCK();
- if (rv != 0) {
+ if (error) {
ipstat_inc(ips_cantforward);
goto bad;
}
-/* $OpenBSD: ip_mroute.c,v 1.118 2017/05/16 13:09:21 rzalamena Exp $ */
+/* $OpenBSD: ip_mroute.c,v 1.119 2017/06/19 17:00:16 bluhm Exp $ */
/* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */
/*
if ((srctun++ % 1000) == 0)
log(LOG_ERR, "ip_mforward: received source-routed "
"packet from %x\n", ntohl(ip->ip_src.s_addr));
-
- return (1);
+ return (EOPNOTSUPP);
}
/*
-/* $OpenBSD: ip6_input.c,v 1.194 2017/05/31 05:59:09 mpi Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.195 2017/06/19 17:00:16 bluhm Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
#ifdef MROUTING
if (ip6_mforwarding && ip6_mrouter[ifp->if_rdomain]) {
+ int error;
+
if (ip6_hbhchcheck(m, &off, &nxt, &ours))
goto out;
* must be discarded, else it may be accepted below.
*/
KERNEL_LOCK();
- if (ip6_mforward(ip6, ifp, m)) {
+ error = ip6_mforward(ip6, ifp, m);
+ KERNEL_UNLOCK();
+ if (error) {
ip6stat_inc(ip6s_cantforward);
- m_freem(m);
- } else if (ours) {
+ goto bad;
+ }
+
+ if (ours) {
+ KERNEL_LOCK();
ip6_deliver(&m, &off, nxt, AF_INET6);
- } else {
- m_freem(m);
+ KERNEL_UNLOCK();
+ goto out;
}
- KERNEL_UNLOCK();
- goto out;
+ goto bad;
}
#endif
if (!ours) {