mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
Networking: Seperate tcp_input() and udp_input() into seprate functions tcp_ipv4_input(), tcp_ipv6_input(), udp_ipv4_input(), and upd_ipv6_input() than can deal will the data offsets caused by the differing sizes of the IP header.
This commit is contained in:
+4
-4
@@ -100,8 +100,8 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
||||
{
|
||||
uint8_t result;
|
||||
|
||||
dev->d_snddata = &dev->d_buf[IPTCP_HDRLEN + NET_LL_HDRLEN(dev)];
|
||||
dev->d_appdata = &dev->d_buf[IPTCP_HDRLEN + NET_LL_HDRLEN(dev)];
|
||||
dev->d_snddata = &dev->d_buf[IPv4TCP_HDRLEN + NET_LL_HDRLEN(dev)];
|
||||
dev->d_appdata = &dev->d_buf[IPv4TCP_HDRLEN + NET_LL_HDRLEN(dev)];
|
||||
|
||||
/* Increase the TCP sequence number */
|
||||
|
||||
@@ -183,7 +183,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
||||
|
||||
/* We also send a reset packet to the remote host. */
|
||||
|
||||
tcp_send(dev, conn, TCP_RST | TCP_ACK, IPTCP_HDRLEN);
|
||||
tcp_send(dev, conn, TCP_RST | TCP_ACK, IPv4TCP_HDRLEN);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
||||
case TCP_LAST_ACK:
|
||||
/* In all these states we should retransmit a FINACK. */
|
||||
|
||||
tcp_send(dev, conn, TCP_FIN | TCP_ACK, IPTCP_HDRLEN);
|
||||
tcp_send(dev, conn, TCP_FIN | TCP_ACK, IPv4TCP_HDRLEN);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user