Hello everyone,

I've recently started to develop certain driver that uses 'ng_cisco' netgraph module for CHDLC en-/de-capsulation. When it connects with ng_cisco node via 'inet' hook, everything works fine, but there is an issue when trying to use 'inet6' node. cisco_notify() routine only sends flow control messages to nodes connected via 'inet' hook, completely ignoring those connected via 'inet6'. This poses some problem if peer node relies on link status information passed from ng_cisco. I'd therefore like to suggest/discuss a patch (attached to this email). All it does is to make ng_cisco node pass flow control messages to *both* 'inet' and 'inet6' peers. It seems to me that it is both possible and sensible to
expect both mentioned hooks to be connected at the same time.

I would appreciate any feedback.

Best regards,
-ŁW
diff --git a/sys/netgraph/ng_cisco.c b/sys/netgraph/ng_cisco.c
index 7e64a0f..12e7e03 100644
--- a/sys/netgraph/ng_cisco.c
+++ b/sys/netgraph/ng_cisco.c
@@ -637,10 +637,20 @@ cisco_notify(sc_p sc, uint32_t cmd)
        struct ng_mesg *msg;
        int dummy_error = 0;
 
-       if (sc->inet.hook == NULL) /* nothing to notify */
+       if (sc->inet.hook == NULL && sc->inet6.hook == NULL)
+               /* nothing to notify */
                return;
-                
-       NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT);
-       if (msg != NULL)
-               NG_SEND_MSG_HOOK(dummy_error, sc->node, msg, sc->inet.hook, 0);
+
+       if (sc->inet.hook != NULL) {
+               NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT);
+               if (msg != NULL)
+                       NG_SEND_MSG_HOOK(dummy_error, sc->node, msg,
+                           sc->inet.hook, 0);
+       }
+       if (sc->inet6.hook != NULL) {
+               NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT);
+               if (msg != NULL)
+                       NG_SEND_MSG_HOOK(dummy_error, sc->node, msg,
+                           sc->inet6.hook, 0);
+       }
 }
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to