In PPP Protocol-Reject package the 'rejected data field' should be a copy
of the rejected package, the copy starts from the data field. besides,
Protocol-Reject package include a 'rejected protocol field', it is the
same as the protocol field of the rejected package.
Protocol-Reject package structure is:
| PPP_header | rejected protocol | rejected data
The rejected package structure is:
| Addr | Control | protocol | data
So the Protocol-Reject package data field is copied from the 3rd byte of
the rejected package.
In case of offline modem when GPRS data connection is connected, if gprs
atom is removed before PPP termination process is complete, the terminate_timer
will not be stop. It will cause ofonod crash when the timer times out.
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)
// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@
- !E
+ E == NULL
// </smpl>
We use IPCP NAK response to stall the progress of acquiring the client
IP address from DHCP server. So we need to increase the max failure of
NAKs in IPCP handshaking.
The biggest update here is that the server needs to be in dormant mode
by default, so as not to send a Configure-Req to the peer until the peer
is ready. This requires adding special constructor for LCP to
initialize it to Stopped state instead of initial state.
Along with this, we pass the server local IP directly to the ppp server
constructor.
remove call to signal_close for lcp object, it is redundent. If
our io is destroyed we are dead, so transition the ppp phase to
DEAD so our disconnect callback can be called.
According to the spec, you must transmit all Link Configuration,
Termination, and Code-Reject packets as if no options had been
negotiated. This requires that when encoding we use the
default ACCM of 0xffffffff when sending these types of packets.
option_process was declared with two gpointer arguments for the sole
reason of being used as a GFunc. Casting to a GFunc or re-writing the
foreach as a loop is preferable.
It is much more compact to re-implement the transition states as a table
as opposed to functions with switch/case statements. The logic is made
much easier to follow and much of the code duplication is eliminated