We should check PIPEX_SFLAGS_IP{,6}_FORWARD bits on the session which we
will output packet, not on the dummy multicast session.

npppd(8) clears these flags before release IP address assigned to
session. So this IP address could be assigned to other session while our
session is still alive.

We should also do this check within pppx_if_qstart(), but I want to do
this with separate diff.

Index: sys/net/pipex.c
===================================================================
RCS file: /cvs/src/sys/net/pipex.c,v
retrieving revision 1.138
diff -u -p -r1.138 pipex.c
--- sys/net/pipex.c     26 Jun 2022 15:50:21 -0000      1.138
+++ sys/net/pipex.c     26 Jun 2022 22:16:17 -0000
@@ -801,7 +801,7 @@ pipex_ip_output(struct mbuf *m0, struct 
                LIST_FOREACH(session_tmp, &pipex_session_list, session_list) {
                        if (session_tmp->ownersc != session->ownersc)
                                continue;
-                       if ((session->flags & (PIPEX_SFLAGS_IP_FORWARD |
+                       if ((session_tmp->flags & (PIPEX_SFLAGS_IP_FORWARD |
                            PIPEX_SFLAGS_IP6_FORWARD)) == 0)
                                continue;
                        m = m_copym(m0, 0, M_COPYALL, M_NOWAIT);

Reply via email to