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:
Gregory Nutt
2015-01-15 15:06:46 -06:00
parent 60e50ff3b5
commit 630366272a
18 changed files with 438 additions and 200 deletions
+4 -4
View File
@@ -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;
}
}