Commit Graph

3223 Commits

Author SHA1 Message Date
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