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



On Wed, 2012-03-14 at 17:13 +0100, Markus Becker wrote:
> 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?

Paul Mackerras takes them, there's a PPP devel list I think.  At any
rate, it's in git here:  http://git.ozlabs.org/?p=ppp.git;a=summary  and
Paul would probably take patches via email.

Dan

> 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));





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