- if (error != 0 || m == NULL) {
- if (m != NULL) {
- panic("%s: unexpected packet %p\n", __func__, m);
- /* NOTREACHED */
+#if PF
+ if (PF_IS_ENABLED) {
+#if DUMMYNET
+ struct ip_fw_args args;
+ bzero(&args, sizeof(args));
+
+ args.fwa_m = m;
+ args.fwa_oif = ifp;
+ args.fwa_oflags = 0;
+ args.fwa_ro6 = ip6forward_rt;
+ args.fwa_ro6_pmtu = ip6forward_rt;
+ args.fwa_mtu = rt->rt_ifp->if_mtu;
+ args.fwa_dst6 = dst;
+ args.fwa_origifp = origifp;
+ /* Invoke outbound packet filter */
+ error = pf_af_hook(ifp, NULL, &m, AF_INET6, FALSE, &args);
+#else /* !DUMMYNET */
+ error = pf_af_hook(ifp, NULL, &m, AF_INET6, FALSE, NULL);
+#endif /* !DUMMYNET */
+ if (error != 0 || m == NULL) {
+ if (m != NULL) {
+ panic("%s: unexpected packet %p\n", __func__, m);
+ /* NOTREACHED */
+ }
+ /* Already freed by callee */
+ goto senderr;