Put back a m_copyback() that got lost in rev 1.837 of pf.c. This
authorbluhm <bluhm@openbsd.org>
Sun, 13 Jul 2014 16:58:43 +0000 (16:58 +0000)
committerbluhm <bluhm@openbsd.org>
Sun, 13 Jul 2014 16:58:43 +0000 (16:58 +0000)
fixes the rewrite of an IPv6 header of an ICMP6 packet in the payload
of an ICMP6 error packet.  Path MTU discovery with ping6 over pf
nat or rdr works again.
Found by src/regress/sys/net/pf_fragment make run-regress-fragping6
OK henning@

sys/net/pf.c

index 162f968..247d6c6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pf.c,v 1.881 2014/07/10 03:17:59 lteo Exp $ */
+/*     $OpenBSD: pf.c,v 1.882 2014/07/13 16:58:43 bluhm Exp $ */
 
 /*
  * Copyright (c) 2001 Daniel Hartmeier
@@ -5249,7 +5249,9 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state,
                                m_copyback(pd->m, pd->off,
                                    sizeof(struct icmp6_hdr), pd->hdr.icmp6,
                                    M_NOWAIT);
-                               m_copyback(pd->m, pd2.off,
+                               m_copyback(pd2.m, ipoff2, sizeof(h2_6), &h2_6,
+                                   M_NOWAIT);
+                               m_copyback(pd2.m, pd2.off,
                                    sizeof(struct icmp6_hdr), &iih, M_NOWAIT);
                                copyback = 1;
                        }