Re: [PATCH] gsm: pass the PPP auth preferences for STATIC and DHCP device use



Hi Dan,

On Monday 12 March 2012, Dan Williams wrote:
> On Wed, 2012-03-07 at 12:37 +0000, Andrew Bird wrote:
> > When using the either DHCP or STATIC IpMethods the modem manager
> > or device itself negotiates the PPP session, so we need to pass
> > the authentication preferences through to MM.
> 
> Instead of individual keys, lets use a u32 bitfield here.  If the
> bitfield doesn't exist in the dict, then MM uses modem default, if it
> does, MM tries to fulfill the request.  If the modem can only accept one
> value (Qualcomm-type devices accept only PAP *or* CHAP with AT$QCPDPP)
> then MM picks the appropriate one from the dict if only one of PAP or
> CHAP was given, otherwise we default to PAP I suppose.
> 
> Dan
> 
> > Signed-off-by: Andrew Bird <ajb spheresystems co uk>
> > ---
> > 
> >  src/modem-manager/nm-modem-gsm.c |   12 ++++++++++++
> >  1 files changed, 12 insertions(+), 0 deletions(-)
> > 
> > diff --git a/src/modem-manager/nm-modem-gsm.c
> > b/src/modem-manager/nm-modem-gsm.c index 66b7ad9..e2c4cc4 100644
> > --- a/src/modem-manager/nm-modem-gsm.c
> > +++ b/src/modem-manager/nm-modem-gsm.c
> > @@ -326,6 +326,7 @@ static GHashTable *
> > 
> >  create_connect_properties (NMConnection *connection)
> >  {
> >  
> >  	NMSettingGsm *setting;
> > 
> > +	NMSettingPPP *s_ppp;
> > 
> >  	GHashTable *properties;
> >  	const char *str;
> > 
> > @@ -384,6 +385,17 @@ create_connect_properties (NMConnection *connection)
> > 
> >  	if (nm_setting_gsm_get_home_only (setting))
> >  	
> >  		value_hash_add_bool (properties, "home_only", TRUE);
> > 
> > +	/* For IpMethod STATIC or DHCP */
> > +	s_ppp = nm_connection_get_setting_ppp (connection);
> > +	if (s_ppp) {
> > +		value_hash_add_bool (properties, "noauth", 
nm_setting_ppp_get_noauth
> > (s_ppp)); +		value_hash_add_bool (properties, "refuse_eap",
> > nm_setting_ppp_get_refuse_eap (s_ppp)); +		value_hash_add_bool
> > (properties, "refuse_pap", nm_setting_ppp_get_refuse_pap (s_ppp));
> > +		value_hash_add_bool (properties, "refuse_chap",
> > nm_setting_ppp_get_refuse_chap (s_ppp)); +		value_hash_add_bool
> > (properties, "refuse_mschap", nm_setting_ppp_get_refuse_mschap (s_ppp));
> > +		value_hash_add_bool (properties, "refuse_mschapv2",
> > nm_setting_ppp_get_refuse_mschapv2 (s_ppp)); +	}
> > +
> > 
> >  	return properties;
> >  
> >  }

	Is the patch I just sent more along the lines of what you'd expect?
Best regards,


Andrew


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