Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-9]: src/sys/netinet Pull up following revision(s) (requested by k...
details: https://anonhg.NetBSD.org/src/rev/25f0e028296c
branches: netbsd-9
changeset: 964208:25f0e028296c
user: martin <martin%NetBSD.org@localhost>
date: Mon Dec 07 19:58:04 2020 +0000
description:
Pull up following revision(s) (requested by kardel in ticket #1143):
sys/netinet/ip_mroute.c: revision 1.164
PR kern/55779:
restore non-desctructive guarantee of ip_mforward() mbuf
argument. This avoids generation invalid UDP checksums
on multicast packets in ip_output().
XXX the root cause of the misguided fix in 2008 should be
XXX investigated
diffstat:
sys/netinet/ip_mroute.c | 39 ++++++++++++++++++++++++++++++++-------
1 files changed, 32 insertions(+), 7 deletions(-)
diffs (74 lines):
diff -r b9825217a1fc -r 25f0e028296c sys/netinet/ip_mroute.c
--- a/sys/netinet/ip_mroute.c Sun Dec 06 10:31:48 2020 +0000
+++ b/sys/netinet/ip_mroute.c Mon Dec 07 19:58:04 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_mroute.c,v 1.163 2018/09/14 05:09:51 maxv Exp $ */
+/* $NetBSD: ip_mroute.c,v 1.163.4.1 2020/12/07 19:58:04 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.163 2018/09/14 05:09:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.163.4.1 2020/12/07 19:58:04 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -225,6 +225,8 @@
static void tbf_send_packet(struct vif *, struct mbuf *);
static void tbf_update_tokens(struct vif *);
static int priority(struct vif *, struct ip *);
+static int ip_mforward_real(struct mbuf *, struct ifnet *);
+
/*
* Bandwidth monitoring
@@ -1268,6 +1270,34 @@
int
ip_mforward(struct mbuf *m, struct ifnet *ifp)
{
+ int rc;
+ /*
+ * save csum_flags to uphold the
+ * "unscathed" guarantee.
+ * ip_output() relies on that and
+ * without it we send out
+ * multicast packets with an invalid
+ * checksum
+ *
+ * see PR kern/55779
+ */
+ int csum_flags = m->m_pkthdr.csum_flags;
+
+ /*
+ * Temporarily clear any in-bound checksum flags for this packet.
+ */
+ m->m_pkthdr.csum_flags = 0;
+
+ rc = ip_mforward_real(m, ifp);
+
+ m->m_pkthdr.csum_flags = csum_flags;
+
+ return rc;
+}
+
+static int
+ip_mforward_real(struct mbuf *m, struct ifnet *ifp)
+{
struct ip *ip = mtod(m, struct ip *);
struct mfc *rt;
static int srctun = 0;
@@ -1305,11 +1335,6 @@
}
/*
- * Clear any in-bound checksum flags for this packet.
- */
- m->m_pkthdr.csum_flags = 0;
-
- /*
* Don't forward a packet with time-to-live of zero or one,
* or a packet destined to a local-only group.
*/
Home |
Main Index |
Thread Index |
Old Index