net: ip: build IEEE 802.15.4 L2 without IP support

While a previous change had already decoupled the IEEE 802.15.4 L2 from
IP upper layers, this only worked when at least one other interface of
the device supported IP.

This change removes this requirement and thereby fixes a build error
that occurred when disabling IP support while maintaining IEEE 802.15.4
L2 support.

Fixes: #48718

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
diff --git a/subsys/net/ip/net_core.c b/subsys/net/ip/net_core.c
index 8909fb3..d2c9eb7 100644
--- a/subsys/net/ip/net_core.c
+++ b/subsys/net/ip/net_core.c
@@ -414,7 +414,7 @@
 	}
 }
 
-/* Called by driver when an IP packet has been received */
+/* Called by driver when a packet has been received */
 int net_recv_data(struct net_if *iface, struct net_pkt *pkt)
 {
 	if (!pkt || !iface) {
diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c
index 8976170..b35900a 100644
--- a/subsys/net/ip/net_pkt.c
+++ b/subsys/net/ip/net_pkt.c
@@ -55,11 +55,11 @@
  */
 #define MAX_IP_PROTO_LEN 8
 #else
-#if defined(CONFIG_NET_ETHERNET_BRIDGE)
+#if defined(CONFIG_NET_ETHERNET_BRIDGE) || defined(CONFIG_NET_L2_IEEE802154)
 #define MAX_IP_PROTO_LEN 0
 #else
-#error "Either IPv6 or IPv4 needs to be selected."
-#endif /* ETHERNET_BRIDGE */
+#error "Some packet protocol (e.g. IPv6, IPv4, ETH, IEEE 802.15.4) needs to be selected."
+#endif /* ETHERNET_BRIDGE / L2_IEEE802154 */
 #endif /* SOCKETS_CAN */
 #endif /* IPv4 */
 #endif /* IPv6 */