IPv6 up notify support for PPP [Was: Re: Re: Implementing IPv6 in modem manager]



Hi,

since we have a device that mimics a GSM card and talks IPv6 negotiated over PPP, I went ahead and tried to get some sort of v6 support into modem-manager.

As a first step: PPP needs a patch to notify of IPv6 coming up. See below. Is anyone able to figure out who is taking patches for PPP? Dan do you have a contact at PPP and can push this?

BR,
Markus

From: Markus Becker <mab comnets uni-bremen de>
Date: Wed, 14 Mar 2012 16:48:44 +0100
Subject: [PATCH] Support for notification of IPv6 up/down for NetworkManager.

---
 pppd/ipv6cp.c |   17 +++++++++++++++++
 pppd/pppd.h   |    8 ++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c
index 4a09c9a..cae9481 100644
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
@@ -179,6 +179,16 @@ int no_ifaceid_neg = 0;
 /* local vars */
 static int ipv6cp_is_up;
 
+/* Hook for a plugin to know when IP protocol has come up */
+void (*ipv6_up_hook) __P((void)) = NULL;
+
+/* Hook for a plugin to know when IP protocol has come down */
+void (*ipv6_down_hook) __P((void)) = NULL;
+
+/* Notifiers for when IPCP goes up and down */
+struct notifier *ipv6_up_notifier = NULL;
+struct notifier *ipv6_down_notifier = NULL;
+
 /*
  * Callbacks for fsm code.  (CI = Configuration Information)
  */
@@ -1282,6 +1292,10 @@ ipv6cp_up(f)
     np_up(f->unit, PPP_IPV6);
     ipv6cp_is_up = 1;
 
+    notify(ipv6_up_notifier, 0);
+    if (ipv6_up_hook)
+	ipv6_up_hook();
+
     /*
      * Execute the ipv6-up script, like this:
      *	/etc/ppp/ipv6-up interface tty speed local-LL remote-LL
@@ -1305,6 +1319,9 @@ ipv6cp_down(f)
 {
     IPV6CPDEBUG(("ipv6cp: down"));
     update_link_stats(f->unit);
+    notify(ipv6_down_notifier, 0);
+    if (ipv6_down_hook)
+	ipv6_down_hook();
     if (ipv6cp_is_up) {
 	ipv6cp_is_up = 0;
 	np_down(f->unit, PPP_IPV6);
diff --git a/pppd/pppd.h b/pppd/pppd.h
index 936cc60..2cd7914 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -258,8 +258,10 @@ extern struct notifier *pidchange;   /* for notifications of pid changing */
 extern struct notifier *phasechange; /* for notifications of phase changes */
 extern struct notifier *exitnotify;  /* for notification that we're exiting */
 extern struct notifier *sigreceived; /* notification of received signal */
-extern struct notifier *ip_up_notifier; /* IPCP has come up */
-extern struct notifier *ip_down_notifier; /* IPCP has gone down */
+extern struct notifier *ip_up_notifier;     /* IPCP has come up */
+extern struct notifier *ip_down_notifier;   /* IPCP has gone down */
+extern struct notifier *ipv6_up_notifier;   /* IPV6CP has come up */
+extern struct notifier *ipv6_down_notifier; /* IPV6CP has gone down */
 extern struct notifier *auth_up_notifier; /* peer has authenticated */
 extern struct notifier *link_down_notifier; /* link has gone down */
 extern struct notifier *fork_notifier;	/* we are a new child process */
@@ -727,6 +729,8 @@ extern int (*allowed_address_hook) __P((u_int32_t addr));
 extern void (*ip_up_hook) __P((void));
 extern void (*ip_down_hook) __P((void));
 extern void (*ip_choose_hook) __P((u_int32_t *));
+extern void (*ipv6_up_hook) __P((void));
+extern void (*ipv6_down_hook) __P((void));
 
 extern int (*chap_check_hook) __P((void));
 extern int (*chap_passwd_hook) __P((char *user, char *passwd));
-- 
1.7.9.1



> 2011/3/20 Guillaume Leclanche <guillaume leclanche net>:
> > 2011/3/19 Dan Williams <dcbw redhat com>:
> >> On Sat, 2011-03-19 at 12:56 +0100, Guillaume Leclanche wrote:
> >> 
> >> 1) detecting the available PDP context types: many many modems only
> >> support the IP type, but others will support the IPV4/V6 types as well,
> >> especially newer ones.  So we'll need to add some code to the enable
> >> sequence (mm-generic-gsm.c) to request AT+CGDCONT=? and pick out the
> >> available PDP context types.  There's code that already does some of
> >> this, but only for AT+CGDCONT? to get the currently defined PDP
> >> contexts, while we need to get the *possible* ones.
> > 
> > Yes, here's what's returned by mine.
> > 
> > AT+CGDCONT=?
> > +CGDCONT: (1-10),("IP"),,,(0-1),(0-1)
> > +CGDCONT: (1-10),("IPV6"),,,(0-1),(0-1)
> > 
> > The 3rd context type will be "IPV4V6". Although it's in 3GPP standards
> > already (R8 for LTE and R9 for UMTS/GPRS), there is at the moment
> > hardware supporting it, neither modems nor operator equipment (Q2
> > 2012).
> 
> Additionnaly some pointers :
> 
> * 3GPP standard with introduction of IPv4v6, Release 9 :
> [2/3G] ftp://ftp.3gpp.org/Specs/2010-12/Rel-9/23_series/23060-970.zip
> [4G] ftp://ftp.3gpp.org/Specs/2010-12/Rel-9/23_series/23401-970.zip
> 
> * Great IETF draft to put "IP" names on 3GPP concepts and know where
> it's going :
> http://tools.ietf.org/html/draft-korhonen-v6ops-3gpp-eps-06
> 
> For PDP IPv4v6 & addressing, you probably want to read 9.2.1 & 9.2.2
> of 3GPP 23060.
> 
> Guillaume
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]