sg
b62f443be5
Fixed comment for NETIF_FLAG_UP after fixing bug #37068
2015-03-06 20:49:47 +01:00
sg
553c4203ab
tcp/udp_netif_ipv4_addr_changed(): don't change specific-address of local tcp_listen/udp_pcb to ANY on address change
2015-03-06 20:25:51 +01:00
Sylvain Rochet
89434f6a2f
PPP, CORE, call netif_set_up() after if4_up and if6_up flags are set, to prevent dropping packets
...
lwIP core might send packet when calling netif_set_up(), don't drop packets
anymore in ppp_netif_output_ip4() and ppp_netif_output_ip6() because flags
are cleared.
2015-03-05 22:00:11 +01:00
sg
4e520cdd30
fixed bug #37068 (netif up/down handling is unclear): correclty separated administrative status of a netif (up/down) from 'valid address' status ATTENTION: netif_set_up() now always has to be called, even when dhcp/autoip is used!
2015-03-05 20:57:43 +01:00
sg
72dcdb7655
fixed bug #43784 (a host should send at least one Router Solicitation)
2015-03-04 21:21:49 +01:00
sg
db5510b866
init.c: raise an error if LWIP_PPP_API==1 but PPP_SUPPORT==0
2015-03-04 21:10:29 +01:00
sg
61e0efa0c7
fixed bug #41094 (Byte-order bug in IPv6 fragmentation header test)
2015-03-04 21:02:52 +01:00
sg
12514c09b2
Fixed bug #39956 (netif_create_ip6_linklocal_address out of bounds access of netif::hwaddr)
2015-03-04 20:58:37 +01:00
sg
90a0590de1
patch by Zach Smith: fixed bug #38153 (nd6_input() byte order issues)
2015-03-04 20:49:02 +01:00
Sylvain Rochet
b09c891290
PPP, PPPoE, removed devname variable from pppoe_disc_input()
...
Only used for debug, reworked in a more clever way. It was actually broken
by design: setting an interface integer into a string without formatting
was quite a dumb idea.
2015-03-02 00:45:19 +01:00
Sylvain Rochet
d28bb04a9c
PPP, PPPoE, improve reliability if we receive a PADT
...
Don't disconnect when we receive a PADT, we let the LCP Echo/Reply find
the fact that PPP session is down. Asking the PPP stack to end the
session require strict checking about the PPP phase to prevent endless
disconnection loops.
Luckily it previously does nothing because PADT frames are rarely sent
with a hunique tag and we only set the sc pointer if we receive a
hunique tag.
2015-03-02 00:16:25 +01:00
Sylvain Rochet
9de1c71ff7
PPP, PPPoE, removed global static buffer only used for debug
...
pppoe_error_tmp[] was only used in one function and only for debug purposes,
moved to stack.
2015-03-02 00:05:55 +01:00
Sylvain Rochet
3ce6dd166c
PPP, L2TP, added link-level IPv6 support
2015-03-01 22:04:24 +01:00
Sylvain Rochet
684bef066f
PPP, L2TP, merged common output code
...
New function: pppol2tp_udp_send(), common output code.
2015-03-01 21:22:21 +01:00
Sylvain Rochet
52f2221be9
PPP, L2TP, check source ip address and port
...
Improve L2TP defensiveness by checking source ip address and port
of input packets.
2015-03-01 21:15:15 +01:00
Sylvain Rochet
1bee131d52
PPP, L2TP, using LNS chosen destination port
...
L2TP LNS might chose its own local port, we actually stored
the port the LNS wanted to use but we never used it.
2015-03-01 21:14:52 +01:00
Sylvain Rochet
2731976a95
PPP, renamed ppp_open to ppp_connect
...
Makes it clear we are initiating the PPP session with ppp_connect
(i.e. acting as a PPP client) so there is no confusion possible
between ppp_connect and ppp_listen.
2015-03-01 10:53:08 +01:00
Sylvain Rochet
f7d5e81130
PPP, SERVER, MSCHAP: move output message from chap_server.message struct to stack
...
chap_server.message is only used in one function, moved to stack.
2015-03-01 00:34:00 +01:00
Sylvain Rochet
371bc91d73
PPP, SERVER: added PPPoS server support
...
New function: ppp_listen(), listen for an incoming PPP connection.
2015-02-28 22:41:18 +01:00
Sylvain Rochet
89771de6d0
PPP, remove VJ callback from link_callbacks if VJ support is not enabled
2015-02-28 21:39:32 +01:00
Sylvain Rochet
71b213df63
PPP, EAP: using MAXNAMELEN define instead of hardcoded 256 size for rhostname
2015-02-28 20:37:41 +01:00
Sylvain Rochet
7f3913ff58
PPP, EAP: removed malloc() and free()
...
Replaced pcb->eap.es_{client,server}.ea_peer pointer to a char table,
replaced strdup() with MEMCPY, etc.
2015-02-28 20:29:40 +01:00
Sylvain Rochet
d884034c9f
PPP, replaced drand48() with magic_pow()
2015-02-28 19:50:25 +01:00
Sylvain Rochet
bec199c4a2
PPP, MAGIC: new function: magic_pow
...
magic_pow() returns a new random number between 0 and (2^pow)-1 included.
2015-02-28 19:36:03 +01:00
Sylvain Rochet
3686110ed2
PPP, SERVER: statically define our name for authentication purposes
...
We don't need that in RAM nor a pointer to a string, a static
define is fine for embedded devices, saved ~257 bytes of RAM.
2015-02-28 18:28:07 +01:00
Sylvain Rochet
708e421ec3
PPP, CORE: code cleaning
2015-02-28 18:08:37 +01:00
Sylvain Rochet
5ae7ee5276
PPP, SERVER: added CHAP authentication support
2015-02-28 17:40:07 +01:00
Sylvain Rochet
65493b421a
PPP, SERVER, CHAP: fixed wrong pointer used on chap_timeout()
2015-02-28 15:36:35 +01:00
Sylvain Rochet
301511a840
PPP, SERVER: added PAP authentication support
...
New ppp auth function: auth_check_passwd() which check the user name and
passwd against configuration.
PAP: check remote user and password
2015-02-28 14:40:09 +01:00
Sylvain Rochet
e86a0a4325
PPP, CORE, SERVER, set auth configuration before auth
...
Set LCP wanted options accordingly to the user auth configuration
if peer is required to authenticate itself.
2015-02-28 13:08:20 +01:00
Sylvain Rochet
8d05279599
PPP, CORE, moved auth configuration from auth_reset() to lcp_resetci()
...
Prepare for PPP_SERVER support, we need to move auth configuration before
lcp_allowoptions is copied into lcp_gotoptions. Restore unused
auth_reset() function using pppd original source code.
2015-02-28 12:59:29 +01:00
Sylvain Rochet
587e0e3e0c
PPP, CORE, beautified ppp_set_auth()
...
Beautified, added PPPAUTHTYPE_MSCHAP_V2 choice support.
2015-02-27 23:55:18 +01:00
Sylvain Rochet
2315f32ca0
PPP, CORE, cleaned struct ppp_settings coding style
2015-02-27 23:12:03 +01:00
Sylvain Rochet
5a71509353
PPP, CORE, IPCP: removed useless ask_for_local boolean
...
We don't need ask_for_local boolean, this is only useful for setup which
can determine the local IP address from the system hostname, which is
probably meaningless for embedded devices (and probably any devices).
It was actually only set by ip_check_options() which is commented out in
lwIP because we don't parse a config file nor check PPP configuration
(user is responsible about writing a configuration which is logical ;-).
Furthermore ask_for_local boolean never set actually had the wrong
default for PPP server setups.
2015-02-27 22:39:42 +01:00
Sylvain Rochet
a310bc19a7
netif: fixed compiler warning
...
lwip/src/core/netif.c: In function ‘netif_set_ipaddr’:
lwip/src/core/netif.c:403:5: warning: implicit declaration of function ‘udp_netif_ipv4_addr_changed’ [-Wimplicit-function-declaration]
udp_netif_ipv4_addr_changed(&netif->ip_addr, ipaddr);
^
2015-02-26 22:45:37 +01:00
sg
0647533f8c
fixed bug #44378 (TCP connections are not aborted on netif remove)
2015-02-26 22:25:39 +01:00
sg
99dd78964a
fixed bug #40753 (re-bind UDP pcbs on change of IP address)
2015-02-26 22:17:30 +01:00
sg
0d1606ff23
Fixed last commit: can only check for bound sockets, not for unbound. There's some work to do for IPv6 in TCP...
2015-02-26 21:31:48 +01:00
sg
a6a92d42f9
Fixed bug #41700 (Call to tcp_listen_dual() should not accept IPv4 listen PCB args)
2015-02-26 21:23:40 +01:00
Sylvain Rochet
2aabe16163
PPP, PPPoS, removed ppp_accm_mask[], saved a few bytes of ROM
...
This was a pretty naive way of doing a bitshift, code is smaller if we let
the compiler decide.
2015-02-25 23:04:55 +01:00
sg
5984c996a8
fixed bug #40177 (System hangs when dealing with corrupted packets), implemented task #12357 (Ensure that malicious packets don't assert-fail): improved some pbuf_header calls to not assert-fail.
2015-02-25 22:58:27 +01:00
sg
c8d126f6ef
work on task #12357 (Ensure that malicious packets don't assert-fail): don't let too short IP packets assert-fail; fix that IPv6 input did not obey VLAN header offset
2015-02-25 22:23:12 +01:00
Joel Cunningham
9004554da3
fixed bug #43028 (IP_MULTICAST_TTL affects unicast datagrams)
2015-02-25 21:59:21 +01:00
Greg Renda
4eb9efdd33
fixed bug #38210 (ip reassembly while remove oldest datagram)
2015-02-25 21:43:39 +01:00
sg
83740d81f2
fixed comment
2015-02-25 21:32:33 +01:00
sg
c8581e4cd9
fixed bug #38165 (socket with mulicast): ensure igmp membership are dropped when socket (not netconn!) is closed.
2015-02-25 21:30:22 +01:00
sg
612e33c499
fixed bug #38061 (wrong multicast routing in IPv4) by adding an optional default netif for multicast routing
2015-02-25 20:58:11 +01:00
sg
3e8ac30940
Fixed bug #44297 (CORE_LOCKING was broken some days ago); fixed that netconn_connect still used message passing for LWIP_TCPIP_CORE_LOCKING==1
2015-02-25 20:34:18 +01:00
Sylvain Rochet
4bcddd72e6
PPP, CORE, cleaned ppp_close() function
...
Calling new_phase() instead of assigning pcb->phase directly.
Removed redundant call to link status callback.
2015-02-24 22:13:04 +01:00
Sylvain Rochet
00bb70a62d
PPP, CORE, functions ppp_set_netif_statuscallback() and ppp_set_netif_linkcallback() replaced with defines
...
PPP is now pointerful for a while, we don't need anymore accessor functions
for the unique PPP local and static control block. Replaced
ppp_set_netif_statuscallback() and ppp_set_netif_linkcallback() functions to
defines.
Removed pppapi_do_ppp_set_netif_statuscallback() and
pppapi_do_ppp_set_netif_linkcallback(), they were useless because
netif_set_status_callback() and netif_set_link_callback() can be
safely called while PPP status is in dead (= non open) state
and even before the PPP session is actually created at all.
2015-02-24 20:41:47 +01:00
Sylvain Rochet
b4990b5bb4
Fixed warnings on whole project introduced by const pointers on ip_addr_t
2015-02-22 22:50:06 +01:00
Sylvain Rochet
65095253a9
PPP, fixed warnings introduced by const pointers on ip_addr_t
2015-02-22 22:38:02 +01:00
sg
c87efb77bc
patch by Jens Nielsen: fixed bug #38803 (Source address in broadcast ping reply)
2015-02-22 22:02:17 +01:00
sg
03159254ce
added proper accessor functions for pcb->multicast_ip (previously used by get/setsockopt only)
2015-02-22 21:49:46 +01:00
sg
ec5cf8593e
Continued chrysn's work: changed nearly all functions taking 'ip(X)_addr_t' pointer to take const pointers (changed user callbacks: raw_recv_fn, udp_recv_fn; changed port callbacks: netif_output_fn, netif_igmp_mac_filter_fn)
2015-02-22 21:46:35 +01:00
chrysn
9f065c0ea5
(api break) qualify ip_addr_t as const where feasible
...
this changes the callback signatures of the ip_output and the
{udp,raw}_recv functions.
changes were made by going through all header files, searching for
occurrences of ip_addr_t, qualifying them as const and if required
modifying the corresponding c files, looking for other uses of ip_addr_t
that would be required.
the following header files were not treated as i'm not using them and
wouldn't see them compiled: api.h api_msg.h dhcp.h dns.h igmp.h
netifapi.h pppapi.h snmp.h snmp_msg.h snmp_structs.h ppp.h pppol2tp.h
test/*
no modifications were done on ip6_addr_t.
2015-02-22 21:46:02 +01:00
Sylvain Rochet
df3f05e824
PPP, apply warnings found by MSVC fixes on other files needing the same fix
2015-02-22 21:39:04 +01:00
sg
9a10afbbc6
PPP: fixed 2 warnings found by MSVC
2015-02-22 21:30:17 +01:00
Sylvain Rochet
8d916b8573
PPP, PPPoS, removed unused next field in pppos_pcb
...
Linked list was removed, we don't need the next pointer anymore.
2015-02-22 16:57:57 +01:00
Sylvain Rochet
653657ae43
PPP, code cleaning
2015-02-22 16:45:38 +01:00
Sylvain Rochet
b0b7240022
PPP, PPPoS, moved advise about modem from pppos_create() to ppp_open()
...
pppos_create() can be called whether the modem is ready to process the
PPP session since pppos_create() does not start the PPP session anymore,
moved the advise from pppos_create() to ppp_open().
2015-02-22 16:20:03 +01:00
Sylvain Rochet
1e82003bf9
CORE, INIT, fail if none of PPP_IPV[46]_SUPPORT are enabled if PPP_SUPPORT is enabled
...
PPP_SUPPORT needs PPP_IPV4_SUPPORT and/or PPP_IPV6_SUPPORT turned on.
2015-02-22 14:30:24 +01:00
Sylvain Rochet
4be7fccad3
PPP, CORE, ppp_close() and ppp_sighup() ended up sharing almost everything, merged
...
Merged ppp_sighup() to ppp_close() using an optional argument "nocarrier"
on ppp_close().
2015-02-22 14:25:36 +01:00
Sylvain Rochet
b040ace4c2
PPP, CORE, carrier lost signal, fixed FSM mismatch
...
ppp_sighup() hard change the PPP FSM phase, it ends up with a FSM
mismatch if PPP is currently connecting or disconnecting.
Only do "sighup" on the stable running phase, fallback to the close
method. Handle special DEAD and HOLDOFF states as well.
2015-02-22 13:54:52 +01:00
Sylvain Rochet
ab572ce5b9
PPP, CORE, fixed PPP phase state machine when ppp_close() is called during HOLDOFF phase
...
Aborting HOLDOFF leaves us at PPP_PHASE_DEAD, fixed.
2015-02-22 13:48:53 +01:00
Sylvain Rochet
ded77f59cd
PPP, FSM, fixed "timeout sending Config-Requests" output
...
\n is not needed, fixed.
2015-02-22 12:12:38 +01:00
Sylvain Rochet
a1c5415f8f
PPP, CORE, disable VJ is PPP IPV4 is compiled out
...
VJ compression is only supported for PPP IPv4, compile out VJ support
if PPP IPv4 is not compiled.
2015-02-22 02:34:45 +01:00
Sylvain Rochet
00e8988b52
PPP, IPv4 support is now optional
...
New compile time option: PPP_IPV4_SUPPORT
PPP IPv4 support can now be compiled out.
2015-02-22 02:28:04 +01:00
Sylvain Rochet
5680808fb6
PPP, CORE, ppp_ioctl PPPCTLG_UPSTATUS command now returns true if only IPv6 is up
...
PPPCTLG_UPSTATUS ioctl didn't return true if IPv6 was up and IPv4 down, fixed.
2015-02-22 01:34:47 +01:00
Sylvain Rochet
814bcc04ad
PPP, CORE, using ip*_set_* functions instead of IP4_ADDR and SMEMCPY
...
Now using lwIP helper functions on ip_addr_t and ip6_addr_t.
2015-02-22 01:33:02 +01:00
Sylvain Rochet
a8cbff08ef
PPP, IPV6, enable PPP IPv6 by default if LWIP_IPV6 is set
2015-02-22 00:25:23 +01:00
Sylvain Rochet
ee8a05c3c7
PPP, CORE, removed if_up and if6_up checks in sifdown() and sif6down()
...
It can't hurt us, checking is useless.
2015-02-21 23:53:40 +01:00
Sylvain Rochet
46d7f6f95d
PPP, IPv6, fixed unicode in file headers
2015-02-21 23:49:57 +01:00
Sylvain Rochet
30c89310a6
PPP, CORE, IPv6, if_up flag used instead of if6_up for outgoing IPv6 packets, fixed
...
We can have an IPv6 only PPP interface, checking if6_up instead of if_up fixes
IPv6 only setup.
ppp_netif_output() which were only used for common code between
ppp_netif_output_ip4() and ppp_netif_output_ip6() is not necessary
anymore, removed, reducing call stack by one.
2015-02-21 23:34:45 +01:00
Sylvain Rochet
d6e1b86147
PPP, CORE, improved, re-ordered and re-numbered IOCTL commands
2015-02-21 21:52:39 +01:00
Sylvain Rochet
a8e973f5d7
PPP, CORE, remove the user ability to set the PPP error code (PPPCTLS_ERRCODE)
...
This is now totally useless, it was used for the PPP core code but it is not
used anymore, remove then the user ability to set the PPP error code through
PPPCTLS_ERRCODE.
2015-02-21 21:48:53 +01:00
Sylvain Rochet
c4d1354c54
PPP, CORE, don't use ppp_ioctl() from PPP core, assign pcb->err_code instead
...
Removed useless calls to ppp_ioctl(pcb, PPPCTLS_ERRCODE, …), we now assign
pcb->err_code directly instead. ppp_ioctl() is not linked anymore if user
application don't use it.
2015-02-21 21:42:59 +01:00
Sylvain Rochet
dc2e700057
PPP, CORE, using u8_t on ioctl command instead of int
...
We don't need an int here, all commands are between 0 and 255.
2015-02-21 21:37:08 +01:00
Sylvain Rochet
bfe0c3a8e0
opt.h: fixed warnings if PPP auth support is not enabled
...
lwip/src/netif/ppp/polarssl/md4.c:43:20: warning: "LWIP_INCLUDED_POLARSSL_MD4" is not defined [-Wundef]
lwip/src/netif/ppp/polarssl/sha1.c:42:20: warning: "LWIP_INCLUDED_POLARSSL_SHA1" is not defined [-Wundef]
lwip/src/netif/ppp/polarssl/des.c:43:20: warning: "LWIP_INCLUDED_POLARSSL_DES" is not defined [-Wundef]
2015-02-21 19:43:04 +01:00
Sylvain Rochet
a387270b76
PPP, PPPoS, fixed PPP_INPROC_MULTITHREADED support
...
Oops.
2015-02-21 19:38:47 +01:00
Sylvain Rochet
59b659b027
PPP, CORE, compile out auth support if none of auth protocols are enabled
...
Added macro PPP_AUTH_SUPPORT, if none of auth protocols are enabled
(PAP, CHAP, EAP) we reduce PPP memory usage by compiling out all
struct fields and source code used for authentication.
2015-02-21 19:32:38 +01:00
Sylvain Rochet
973472c51e
opt: clarified VJ support
...
VJ is only supported for PPPoS, RFCs does not say VJ is forbidden on
PPPoE or PPPoL2TP (looks like it is strongly discouraged though, due
to checksum issues when using VJ).
2015-02-21 18:43:31 +01:00
Sylvain Rochet
f57d4818a4
PPP, using PPP netif->num number instead of ppp->num
...
Saved 2 bytes of RAM if debug is enabled, we are now using the
netif->num number instead of using our own ppp->num
2015-02-21 01:21:24 +01:00
Sylvain Rochet
6b4db944dd
PPP, using err_t return code instead of PPPERR_
...
Standardised PPP API to follow lwIP already used return codes.
PPPERR_ are now used only on link status callback.
2015-02-20 21:24:58 +01:00
Sylvain Rochet
0a761d238a
PPP, using err_t return type on ppp_ioctl()
2015-02-20 21:01:24 +01:00
Sylvain Rochet
c8f026c382
PPP, PPPoS, removed PPPERR_ on err_t return type
2015-02-20 20:54:05 +01:00
Sylvain Rochet
2c70c12814
PPP, PPPoL2TP, removed PPPERR_ usage
...
Low level protocol callbacks are using err_t returns type,
don't use PPPERR_ on them.
2015-02-20 20:52:10 +01:00
Sylvain Rochet
b31f6eb45f
PPP, PPPoE, removed PPPERR_ usage
...
Low level protocol callbacks are using err_t returns type,
don't use PPPERR_ on them.
2015-02-20 20:51:37 +01:00
Sylvain Rochet
d387c1c83a
PPP, PPPoS, added missing static modifier on pppos_netif_input()
2015-02-20 19:35:12 +01:00
Sylvain Rochet
7a1a2b9aa6
PPP, PPPoS, code cleaning
2015-02-20 01:00:48 +01:00
Sylvain Rochet
444da3ecec
PPP, CORE, we don't need PPP_LINK_ENABLED_NUMBER anymore
2015-02-20 00:44:58 +01:00
Sylvain Rochet
1918914598
PPP, PPPoS, removed linked list
...
We don't need anymore the PPPoS linked list since we have callbacks
for everything.
2015-02-20 00:40:45 +01:00
Sylvain Rochet
29f3f2e1d8
PPP, PPPoS, moved VJ protocol handler to PPPoS
...
New callback, netif input, allow low level drivers to extend
ppp_input call, moved PPPoS VJ support to pppos.c.
2015-02-20 00:40:45 +01:00
Sylvain Rochet
759d11ce1a
PPP, CORE, beautified ppp_ioctl()
2015-02-20 00:40:45 +01:00
Sylvain Rochet
729e24da78
PPP, PPPoS, added sub-ioctl commands
...
Allow low level drivers to extend ioctl call, moved PPPoS ioctl
commands to pppos.c.
2015-02-20 00:40:45 +01:00
Sylvain Rochet
ec362536f5
PPP, uniformised callbacks naming
2015-02-20 00:40:45 +01:00
Sylvain Rochet
b92fe3eecb
PPP, CORE, new callbacks, send_config, recv_config, vj_config
...
Removed some calls from PPP core to PPPoS low level protocols,
the const struct allows us to have more and more callbacks
without using more RAM.
2015-02-20 00:40:44 +01:00
Sylvain Rochet
985de035bc
PPP, CORE, now using const callbacks struct from lower level protocols
...
Saving some RAM by using callbacks struct in rodata for required
callbacks called by PPP core to PPP low level protocols.
2015-02-20 00:40:44 +01:00
Sylvain Rochet
2e40ceaaa4
CORE, enabling only PPPoL2TP is also a valid choice
2015-02-20 00:40:44 +01:00
Ivan Delamer
02a797f9f9
Modified netif flag values.
2015-02-19 16:25:30 -07:00
Ivan Delamer
b938154f6b
Removed unused netif flag for DHCP
2015-02-19 16:22:19 -07:00
Ivan Delamer
e312ebcb57
Removed unused netif flag for point to point connections
2015-02-19 16:19:29 -07:00
Sylvain Rochet
02cf50063e
PPP, PPPoX, added warnings about functions in headers which should not be called from lwIP user application
2015-02-18 23:14:30 +01:00
Sylvain Rochet
f511bec26c
PPP, PPPoS, only check PPPoS PCB pointer if PPPoS is not the only enabled lower protocol
...
We only need to keep track of existing PPPoS interfaces if PPPoS
is not the only enabled protocol.
PPP CORE does not have callbacks pointers for all PPPoS callbacks
which should actually be required for PPPoS (VJ config, asyncmap, ...),
there is too much callbacks to create and PPPoS must be kept light,
especially for users who are only using PPPoS.
But there is a drawback, PPP CORE does not know which
lower protocols it is talking to thanks to the abstraction,
therefore if PPPoS is enabled as well as PPPoE or PPPoL2TP there
might be situation where PPP CORE calls pppos_ config functions
on interfaces which are NOT PPPoS one. This is very unlikely to
happen because protocols not supported by PPPoE or PPPoL2TP are
disabled at LCP/IPCP negotiation but we are better safe than sorry.
So we check if passed PPP pointer to PPPoS configuration functions
is a PPPoS interface by checking against a linked list of existing
PPPoS interfaces.
2015-02-18 23:14:30 +01:00
Sylvain Rochet
9f93c16bbf
PPP, CORE, beautified auth protocols debug
2015-02-18 23:14:29 +01:00
Sylvain Rochet
892e75ca92
PPP, CORE, removed useless include of chap-new.h
2015-02-18 23:14:29 +01:00
Sylvain Rochet
5e73068e09
PPP, CORE, Removed (*datainput) from struct protent if not used
...
Data input is only used by CCP and ECP, which are not supported at this time,
remove this entry from struct protent to save some flash.
2015-02-18 23:14:29 +01:00
Sylvain Rochet
b71d9ce3f6
PPP, CORE, Removed useless enabled_flag from struct protent
...
Our struct protent are const everywhere to save RAM, enable/disable
flag on a const struct is useless, saving some flash, removed.
2015-02-18 23:14:29 +01:00
sg
730529353d
fixed bug #37958 "netconn API doesn't handle correctly connections half-closed by peer"
2015-02-18 22:21:26 +01:00
sg
101f57d5e0
tcp_alloc() prefers killing CLOSING/LAST_ACK over active connections (see bug #39565 ) (tcp_kill_prio(): back to old implementation)
2015-02-18 21:30:45 +01:00
sg
2cfc9e286e
"Not connected" shouldn't be fatal (as opposed to "closed")
2015-02-18 20:39:20 +01:00
sg
998ed99288
Fixed select not reporting received FIN as 'readable' in certain rare cases (bug #43779 : select(), close(), and TCP retransmission error)
2015-02-18 20:38:42 +01:00
goldsimon
9048a7f021
fixed compiler warning in dhcp.c
2015-02-18 09:02:37 +01:00
Sylvain Rochet
1c91bb5a20
PPP, PPPoS, fixed warnings with PPPDEBUG disabled
2015-02-18 00:59:27 +01:00
Sylvain Rochet
19fdeae4ba
PPP, chained returns up to ppp_free()
...
ppp_free() now returns lower level protocol return value if something failed.
2015-02-17 23:22:15 +01:00
Sylvain Rochet
50ecd2c12c
PPP, CORE, removed useless st variable in ppp_close()
...
Code cleaning.
2015-02-17 23:22:15 +01:00
Sylvain Rochet
07f9212799
PPP, chained returns up to ppp_open()
...
ppp_open() now returns lower level protocol return value if something failed.
2015-02-17 23:22:15 +01:00
Sylvain Rochet
8a8cba75a2
PPP, lower protocols, chained returns from local functions to callback caller
...
PPPoS,PPPoE,PPPoL2TP functions using non-void returns are now propagated
to callback caller (PPP core).
2015-02-17 23:22:15 +01:00
Sylvain Rochet
1ae3808e13
PPP, CORE, prepared for lower protocols callbacks returning state
...
Until now, callbacks used void return, preparing callbacks to return
PPPERR_ status.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
ee2936ffbf
PPP, all protocols, uniformised naming
...
Uniformised fonction naming between and inside PPPoS, PPPoE, PPPoL2TP.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
5b29f1cdec
PPP, CORE, Fixed warning with PPP_PROTOCOLNAME enabled
...
lwip/src/netif/ppp/ppp.c: In function ‘ppp_input’:
lwip/src/netif/ppp/ppp.c:769:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
const char *pname = protocol_name(protocol);
^
2015-02-17 23:22:14 +01:00
Sylvain Rochet
bce29ac353
PPP, CORE, code cleaning
...
Reordered functions in the order they are declared in headers.
Removed useless ppp_link_down() function.
Merged ppp_stop() and ppp_close().
Merged ppp_hup() and ppp_sighup().
2015-02-17 23:22:14 +01:00
Sylvain Rochet
f7584fa883
PPP, CORE, fixed callbacks return value
...
Fixed return value in case of abnormal termination.
Set pcb->err_code in case of failed setup link.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
18074ff98f
PPP, PPPoE, improved removal from linked list
...
Replaced naive link list removal code to a more clever one.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
4ad60b477c
PPP, PPPoS, structure size optimisation
...
Reordered PPPoS structure so there is no alignment hole for 32 and 64 bits
systems. Reduced types which were too large.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
69469496e2
PPP, PPPoS, moved out_accm from PPP core to PPPoS
...
Last PPPoS variable in PPP core moved to PPPoS.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
baaa2592a6
PPP, PPPoS, removed xmit_accm, almost duplicate of out_accm
...
xmit_accm was meant to be a user configurable asyncmap, it was actually
broken since the introduction of ppp_new by the way we now reset the PPP
initial state, looks like no one until now is needing it anymore. If
necessary we will reintroduce this feature later properly instead of a
dirty and ugly hack into the PPP code.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
ecb8aa6fc1
PPP, PPPoS, merged ppp(os)_pcb_rx to pppos_pcb
...
Merged ppp(os)_pcb_rx to pppos_pcb, saved 8 bytes of pointers
and unecessary init steps.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
34210901bf
PPP, PPPoS, moved ppp.rx to pppos.rx
...
PPP rx control block moved to PPPoS
2015-02-17 23:22:14 +01:00
Sylvain Rochet
7132893863
PPP, PPPoS, re-enabled PPPCTLG_FD
...
Found a fine way to get PPP fd without making this call crash for for PPPoE
or PPPoL2TP.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
cfe04d4453
PPP, PPPoS, using PPPoS PCB pointer on VJ and pppos_ configuration functions
...
Slightly more consistent this way, and prevent using link_ctx_cb pointer
from PPPoS protocol file.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
f98f2890f3
PPP, PPPoS, check if PPPoS configuration functions are used on PPPoS
...
We don't have callbacks which can be set or cleared for PPPoS
configuration, there is too much callbacks to create and PPPoS must be
kept light, therefore PPPoS functions can be called when PPP core
configure a PPPoE or PPPoL2TP interface, this is very unlikely to
happens because protocols not supported by PPPoE or PPPoL2TP are
disabled at LCP/IPCP negotiation but being safe is still better.
Check if passed PPP pointer to PPPoS configuration functions is a PPPoS
interface by using a linked list of exiting PPPoS interfaces.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
d93c21349f
PPP, PPPoS, fixed build with PPP_FCS_TABLE=1
...
Oops, I managed to break builds with PPP_FCS_TABLE=1, fixed.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
9358dbbd99
PPP, PPPoS, various static and const added
...
ppp_get_fcs() is now static, const modifier added on ppp_accm_mask
2015-02-17 23:22:13 +01:00
Sylvain Rochet
2b9d304816
PPP, PPPoS, renamed *sc pointer to *pppos, renamed *pcb pointers to *pppos and *ppp
...
It was a bit confusing and error prone having *pcb pointers for both
ppp_pcb* and pppos_pcb*, fixed confusion with a strict naming for both.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
e6465a6f44
PPP, PPPoS, moved VJ from PPP core to PPPoS
...
VJ is only available for PPPoS, moved VJ from PPP CORE to PPPoS.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
4aa9244b92
PPP, PPPoS moved fd from ppp_pcb to pppos_pcb
...
Moved fd from ppp_pcb to pppos_pcb.
However PPP ioctl PPPCTLG_FD is temporarily disabled until I found a
better solution.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
1ac4d1b793
PPP, PPPoS needs vj.h
2015-02-17 23:22:13 +01:00
Sylvain Rochet
ea205f2fcd
PPP, add PPPoS CB for PPPoS private data
...
Created a new PPPoS CB going to have PPPoS private data, so allocating a
PPPoE or a PPPoL2TP interface does not allocate as well PPPoS variables.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
9c15ffbb74
PPP: Moved PPPoS from ppp.c to pppos.c
...
Started removing from PPP core most of low level protocol PPPoS
handling to separate files, using the new low level PPP callbacks.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
09b4485870
PPP, generalized callbacks calls from PPP core, removed all PPPoE and PPPoL2TP references
...
Almost there, removed all PPPoE and PPPoL2TP references from PPP core,
using the generic callbacks interface everywhere.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
19282d6d6c
PPP, moved low level protocol connect init to low level protocol files
...
Low level protocol init machine state does not belong to PPP core,
moved those init to respective low level protocol files.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
ee85aaccd2
PPP, removed low level create functions from PPP core
...
ppp_over_ethernet_create() moved from ppp.c to pppoe.c
ppp_over_l2tp_create() moved from ppp.c to pppol2tp.c
2015-02-17 23:22:13 +01:00
Sylvain Rochet
0afc34f6fc
PPP, moved ppp_write and ppp_netif_output low level protocols functions to respective low level protocol files
...
Moved ppp_write_over_ethernet() and ppp_netif_output_over_ethernet() to pppoe.c
Moved ppp_write_over_l2tp() and ppp_netif_output_over_l2tp() to pppol2tp.c
2015-02-17 23:22:13 +01:00
Sylvain Rochet
45bfccfddc
PPP, prepare new callbacks for low level protocols
...
New callbacks: write and netif_output
2015-02-17 23:22:13 +01:00
Sylvain Rochet
f8501478f6
PPP: prepared callbacks from PPP core to low level protocols
...
New PPP callback from PPP core to low level protocols, first
step about removing named calls to low level protocols from PPP core.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
a5582e0960
PPP: re-order functions in the common sense API order
...
Re-order ppp.[ch] functions in the order functions should be called from
user application. Moved create functions, which actually return a PPP
control block before functions needing a PPP control block.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
b4fe72c4a2
PPP: removed duplicated code in ppp_close()
...
Looks like previous refactoring and cleaning made ppp_close()
consistent for all our low level protocol backends, cleaned
up duplicated code.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
48f7678771
PPP: re-order prototypes, ppp_init before ppp_new
...
Cosmetic only.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
808098413c
PPP: removed PPPoE and PPPoL2TP callback status notifier
...
Added necessary PPP core functions for PPPoE and PPPoL2TP status
notificaton (ppp_link_failed and ppp_link_end), removed callback,
low level protocol are now calling PPP core "link" functions.
2015-02-17 23:22:12 +01:00