All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 03/11] gatppp: Add PPP server extension
Date: Mon, 21 Jun 2010 23:26:34 -0500	[thread overview]
Message-ID: <201006212326.35035.denkenz@gmail.com> (raw)
In-Reply-To: <33AB447FBD802F4E932063B962385B351F543DFF@shsmsx501.ccr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2718 bytes --]

Hi Zhenhua,

> >> +void ipcp_set_server_info(struct pppcp_data *pppcp, guint32
> >> local_addr, +				guint32 peer_addr, +				guint32 dns1, guint32 dns2,
> >> +				guint32 nbns1, guint32 nbns2)
> >> +{
> >> +	struct ipcp_data *ipcp = pppcp_get_data(pppcp);
> >> +
> >> +	ipcp->req_options = REQ_OPTION_IPADDR | REQ_OPTION_DNS1 |
> >> +				REQ_OPTION_DNS2 | REQ_OPTION_NBNS1 |
> >> +				REQ_OPTION_NBNS2;
> >> +
> >> +	ipcp->local_addr = local_addr;
> >> +	ipcp->peer_addr = peer_addr;
> >> +	ipcp->dns1 = dns1;
> >> +	ipcp->dns2 = dns2;
> >> +	ipcp->nbns1 = nbns1;
> >> +	ipcp->nbns2 = nbns2;
> >> +
> >> +	ipcp_generate_config_options(ipcp);
> >
> > Please note that this function is currently having no effect,
> > you're missing a
> > call to pppcp_set_local_options.  However, in the case of a server, we
> > actually do not want to request DNS or NBNS, and we should
> > only send our local
> > address to the peer if it is non-zero.  Please note that all
> > PPP modems we
> > have encountered so far, do not send their local IP address in
> > a Configure-
> > Request.  Thus calling ipcp_set_server_info should end up
> > generating an empty
> > Configure-Request or with only the local IP address present.
> 
> It's confused me a little. Please correct me if I am wrong. I think PPP
>  modem should send their local IP address to peer in a Configure-Request.
>  So client could accept the peer address in ipcp_rcr.

This is correct if the PPP server wants to do so, it is perfectly OK for the 
server not to send its IP address (e.g. if it doesn't have one.)  This is what 
we observe on most PPP modems.

> 
> In the case of a server, ipcp_set_server_info() should set local, peer, DNS
>  and NBNS info and call pppcp_set_local_options(). And server only send our
>  local address to peer in a Configure-Request.

I'd modify this slightly.  If ipcp_set_server_info is called with server's 
local address as 0, then don't even send IP-Address in a configure Request.  
This wouldn't make sense, in effect the server is asking the client to provide 
its IP address. Otherwise, go ahead and send it (as the client will simply 
ack).

> 
> >> +}
> >> +
> >>  static void ipcp_reset_config_options(struct ipcp_data *ipcp)  {
> >>  	ipcp->req_options = REQ_OPTION_IPADDR | REQ_OPTION_DNS1 |
> >>  				REQ_OPTION_DNS2 | REQ_OPTION_NBNS1 |
> >>  				REQ_OPTION_NBNS2;
> >> -	ipcp->ipaddr = 0;
> >> +	ipcp->local_addr = 0;
> >
> > In the case of a server, the local_address should not be reset.
> 
> It seems we need to add a flag in ipcp_data to indicate whether it's server
>  or not. Does it make sense?

Might be a good idea.

Regards,
-Denis

  reply	other threads:[~2010-06-22  4:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-12  5:50 [PATCH 00/11] Add PPP server support Zhenhua Zhang
2010-06-12  5:50 ` [PATCH 01/11] gatserver: Suspend/resume GAtServer with GAtIO Zhenhua Zhang
2010-06-12  5:50   ` [PATCH 02/11] gatserver: Check for disconnection when resuming Zhenhua Zhang
2010-06-12  5:50     ` [PATCH 03/11] gatppp: Add PPP server extension Zhenhua Zhang
2010-06-12  5:50       ` [PATCH 04/11] atmodem: Fix GAtPPPConnectFunc interface change Zhenhua Zhang
2010-06-12  5:50         ` [PATCH 05/11] test-server: Fix GIOChannel leak in create_tty Zhenhua Zhang
2010-06-12  5:50           ` [PATCH 06/11] test-server: Add PPP server support Zhenhua Zhang
2010-06-12  5:50             ` [PATCH 07/11] test-server: Configure network interface Zhenhua Zhang
2010-06-12  5:50               ` [PATCH 08/11] gsmdial: Configure network interface for PPP Zhenhua Zhang
2010-06-12  5:50                 ` [PATCH 09/11] gsmdial: Unref ppp when we get disconnected Zhenhua Zhang
2010-06-12  5:50                   ` [PATCH 10/11] test-server: Delay ppp_unref after IO processing Zhenhua Zhang
2010-06-12  5:50                     ` [PATCH 11/11] gsmdial: " Zhenhua Zhang
2010-06-12  6:03                       ` Zhang, Zhenhua
2010-06-18 17:51                         ` Denis Kenzior
2010-06-18 17:50                   ` [PATCH 09/11] gsmdial: Unref ppp when we get disconnected Denis Kenzior
2010-06-18 17:50           ` [PATCH 05/11] test-server: Fix GIOChannel leak in create_tty Denis Kenzior
2010-06-18 17:49       ` [PATCH 03/11] gatppp: Add PPP server extension Denis Kenzior
2010-06-21  2:38         ` Zhang, Zhenhua
2010-06-22  4:26           ` Denis Kenzior [this message]
2010-06-22  6:31             ` Zhang, Zhenhua
2010-06-18 17:31     ` [PATCH 02/11] gatserver: Check for disconnection when resuming Denis Kenzior
2010-06-18 17:31   ` [PATCH 01/11] gatserver: Suspend/resume GAtServer with GAtIO Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006212326.35035.denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.