Hi Denis, Zhang, Zhenhua wrote: > Hi Denis, > >> As mentioned above, if Primary / Secondary NBNS server is sent >> by the client, >> we need to Conf-Rej just those options to the client. Any >> other unrecognized >> options should also be Conf-Rejected. The order is important >> here, read the >> spec for details. The IP Address, DNS1/DNS2 should not be >> Conf-Rejected. > > Looks like we need more Conf-Nak than Conf-Reject in ipcp_rcr. :-) > > As PPP client, actually I think we don't need to send NBNS > request at all. It's clear that pppd client only requests > IP/DNS in Conf-Req. Secondly, if server sent us empty > Conf-Req, the client should request server IP address in > Conf-Nak response, instead of Conf-Rej all options. Once we > get local_addr from server, we return Conf-Ack in ipcp_rcr and > don't request server IP any more. > > See attached pppd.log for details.
Ops, forgot the attachment. Attached again. >>> + if (ipcp->is_server) { >>> + guint8 *options; >>> + guint16 len; >>> + >>> + /* Reject if we have not assign client address yet */ >>> + if (ipcp->peer_addr == 0 && ipcp->dns1 == 0 && ipcp->dns2 == 0) >>> + goto reject; >> >> Actually you should be NAKing here, not Rejecting. Reject >> means you don't >> support this option at all. > > Okay. > >>> + >>> + /* Acknowledge client options if it matches with server options >>> + */ + if (ipcp->peer_addr == peer_addr && >>> + ipcp->dns1 == dns1 && >> ipcp->dns2 == dns2 && >>> + ipcp->nbns1 == nbns1 && >> ipcp->nbns2 == nbns2) >>> + return RCR_ACCEPT; >>> + >>> + /* Send client IP/DNS/NBNS information in the config options */ >>> + options = > ipcp_generate_peer_config_options(ipcp, &len); + if >>> (!options) + goto reject; >>> + >>> + *new_len = len; >>> + *new_options = options; >>> + >>> + return RCR_NAK; >>> + } >>> + >>> + /* Client */ >>> + if (peer_addr && ipcp->peer_addr == 0) { >>> + /* RFC 1332 section 3.3 >>> + * As client, accept the server IP as peer's address + >>> */ >>> + ipcp->peer_addr = peer_addr; >>> + > > As client, can we just accept peer_addr as long as it's no > zero, and return Conf-Ack? No matter what ipcp->peer_addr is. > >>> return RCR_ACCEPT; >>> + } >>> >>> +reject: >>> /* Reject all options */ >>> *new_len = ntohs(packet->length) - sizeof(*packet); >>> *new_options = g_memdup(packet->data, *new_len); >>> @@ -317,7 +446,7 @@ struct pppcp_data *ipcp_new(GAtPPP *ppp) } >>> >>> pppcp_set_data(pppcp, ipcp); >>> - ipcp_reset_config_options(ipcp); >>> + ipcp_reset_client_config_options(ipcp); >>> pppcp_set_local_options(pppcp, ipcp->options, ipcp->options_len); >>> >>> return pppcp; >>> >> >> Regards, >> -Denis > > > > Regards, > Zhenhua > > _______________________________________________ > ofono mailing list > ofono@ofono.org > http://lists.ofono.org/listinfo/ofono Regards, Zhenhua
pppd.log
Description: pppd.log
_______________________________________________ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono