zephyr/subsys/net/ip
Michael Scott a4f4f6d6f3 net: net_if: avoid deref of NULL L2
When using offloaded network, an L2 is never assigned to the net_if.
Only certain portions of the net_if code are referenced such as:
net_if_up()
net_if_down()

And these functions make use of several L2 references:
get_flags()
enable()

Let's add checks to make sure we don't deref a NULL when using these
functions.

Fixes the following exception on K64F and other HW which can make
use of offloaded network HW:
FATAL: ***** Reserved Exception ( -16) *****
FATAL: r0/a1:  0x00000010  r1/a2:  0x0000644f  r2/a3:  0x00000000
FATAL: r3/a4:  0x00000000 r12/ip:  0x2000474c r14/lr:  0x0001475b
FATAL:  xpsr:  0x00000000
FATAL: Faulting instruction address (r15/pc): 0x0001b1cd
FATAL: >>> ZEPHYR FATAL ERROR 0: CPU exception
FATAL: Current thread: 0x20004c4c (unknown)

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/18957

Signed-off-by: Michael Scott <mike@foundries.io>
2019-09-08 22:08:02 -04:00
..
6lo_private.h net: ip: 6lo (IPHC) uncompression rework 2019-07-25 15:19:28 +03:00
6lo.c net: ip: 6lo: Remove unnecessary net_buf allocation and memmove 2019-07-25 15:19:28 +03:00
6lo.h cleanup: include/: move misc/slist.h to sys/slist.h 2019-06-27 22:55:49 -04:00
canbus_socket.c net: l2: 6LoCAN implementation 2019-08-08 13:25:01 +03:00
canbus_socket.h
CMakeLists.txt cmake: Don't have users call zephyr_link_interface on mbedTLS 2019-05-11 08:35:26 -04:00
connection.c cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
connection.h cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
dhcpv4.c net/ip/dhcpv4: Set source IP address in DHCP Request 2019-04-17 10:35:38 -05:00
dhcpv4.h net/dhcpv4: Avoid ifdefs when using net_dhcpv4_init() 2019-04-03 09:32:39 -04:00
icmpv4.c cleanup: include/: move misc/slist.h to sys/slist.h 2019-06-27 22:55:49 -04:00
icmpv4.h net/icmpv4: Allow for arbitrary payload data in ICMP echo 2019-04-26 09:05:14 +03:00
icmpv6.c cleanup: include/: move misc/slist.h to sys/slist.h 2019-06-27 22:55:49 -04:00
icmpv6.h cleanup: include/: move misc/slist.h to sys/slist.h 2019-06-27 22:55:49 -04:00
ipv4_autoconf_internal.h net/ethernet: Cleanup a bit on the usage of ifdefs 2019-07-10 15:24:32 +03:00
ipv4_autoconf.c all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
ipv4.c net: ipv4: Drop pkt if src address is unspecified 2019-07-09 21:02:27 +03:00
ipv4.h net/ipv4: Replace legacy net_ipv4_create by the new one 2019-03-20 10:27:14 -05:00
ipv6_fragment.c net: ipv6: Fix fragmentation 2019-07-23 15:40:27 +03:00
ipv6_mld.c net: mgmt: Send event with info when applicaple 2019-07-01 13:50:08 -07:00
ipv6_nbr.c net: ip: ipv6_nbr: Make LLAO length calculation more universal 2019-08-09 15:11:45 +03:00
ipv6.c net: ipv6: Check sub-option length 2019-08-27 14:02:32 +02:00
ipv6.h net: ipv6: Fix IPv6 neighbor table 2019-03-25 22:49:52 -04:00
Kconfig net: l2: 6LoCAN implementation 2019-08-08 13:25:01 +03:00
Kconfig.debug
Kconfig.ipv4 net: ipv4: Allow UDP packets with broadcast dst address 2019-05-20 14:11:11 +03:00
Kconfig.ipv6 net: bt: Add multi-link support 2019-05-07 11:16:29 +03:00
Kconfig.mgmt tests: net: increase stack size 2019-08-08 13:50:32 -07:00
Kconfig.stack
Kconfig.stats net: ppp: Initial support for point-to-point protocol 2019-07-29 10:24:46 +03:00
nbr.c net: nbr: Set the link address type when saving neighbor data 2019-06-13 19:47:31 +03:00
nbr.h
net_context.c net: context: sendmsg: Allow use of connected UDP sockets 2019-08-08 23:13:51 +03:00
net_core.c net: connection: The connection logic was not init properly 2019-06-18 17:58:00 +03:00
net_if.c net: net_if: avoid deref of NULL L2 2019-09-08 22:08:02 -04:00
net_mgmt.c net: mgmt: Add info length to event wait API 2019-07-01 13:50:08 -07:00
net_pkt.c net: ip: net_pkt: Implement net_pkt_shallow_clone 2019-08-08 13:25:01 +03:00
net_private.h net/gptp: net_gptp_recv() dummy function needs to return a verdict 2019-07-10 15:24:32 +03:00
net_shell.c net: l2: 6LoCAN implementation 2019-08-08 13:25:01 +03:00
net_shell.h
net_stats.c
net_stats.h net: Collect network packet TX send time 2019-07-03 09:42:45 +03:00
net_tc_mapping.h
net_tc.c
packet_socket.c
packet_socket.h
promiscuous.c
route.c cleanup: include/: move misc/slist.h to sys/slist.h 2019-06-27 22:55:49 -04:00
route.h cleanup: include/: move misc/slist.h to sys/slist.h 2019-06-27 22:55:49 -04:00
tcp_internal.h net/context: Remove token parameter from net_context_send/sendto 2019-03-20 10:27:14 -05:00
tcp.c net: l2: 6LoCAN implementation 2019-08-08 13:25:01 +03:00
trickle.c cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
udp_internal.h net/udp: Remove net_udp_insert legacy function 2019-03-20 10:27:14 -05:00
udp.c net/udp: Always drop IPv6 UDP packet if checksum field is 0 2019-05-30 13:02:25 +08:00
utils.c net: ip: utils: Corrected memcpy length for port in parse_ipv6 2019-09-08 12:37:16 +02:00