Skip to content

Commit 32f3ce3

Browse files
rluboskartben
authored andcommitted
net: connection: Split net_conn_input()
The current implementation of net_conn_input() can accept different packet types, with completely different processing code, resulting in a function which is pretty bloated, sliced with conditionally enabled code and hard to understand and therefore maintain. This commit splits that function into smaller ones, specialized for different packet types (and entry levels). The following functions have been extracted from the original one: - net_conn_packet_input() for early packet processing (covering AF_PACKET family sockets) - net_conn_raw_ip_input() for raw IP packets processing (covering AF_INET(6)/SOCK_RAW sockets) - net_conn_can_input() for CAN packets processing (covering AF_CAN family sockets) The net_conn_input() function stripped from above cases now only takes care of packets that have been processed by respective L4 and are intended for regular TCP/UDP sockets. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
1 parent edba291 commit 32f3ce3

File tree

6 files changed

+311
-143
lines changed

6 files changed

+311
-143
lines changed

subsys/net/ip/canbus_socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ enum net_verdict net_canbus_socket_input(struct net_pkt *pkt)
2323
__ASSERT_NO_MSG(net_pkt_family(pkt) == AF_CAN);
2424

2525
if (net_if_l2(net_pkt_iface(pkt)) == &NET_L2_GET_NAME(CANBUS_RAW)) {
26-
return net_conn_input(pkt, NULL, CAN_RAW, NULL);
26+
return net_conn_can_input(pkt, CAN_RAW);
2727
}
2828

2929
return NET_CONTINUE;

0 commit comments

Comments
 (0)