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

View File

@@ -275,7 +275,7 @@ void tcp_reset(FAR struct net_driver_s *dev)
#endif
pbuf->flags = TCP_RST | TCP_ACK;
dev->d_len = IPTCP_HDRLEN;
dev->d_len = IPv4TCP_HDRLEN;
pbuf->tcpoffset = 5 << 4;
/* Flip the seqno and ackno fields in the TCP header. */
@@ -362,7 +362,7 @@ void tcp_ack(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
pbuf->optdata[1] = TCP_OPT_MSS_LEN;
pbuf->optdata[2] = TCP_MSS(dev) / 256;
pbuf->optdata[3] = TCP_MSS(dev) & 255;
dev->d_len = IPTCP_HDRLEN + TCP_OPT_MSS_LEN;
dev->d_len = IPv4TCP_HDRLEN + TCP_OPT_MSS_LEN;
pbuf->tcpoffset = ((TCP_HDRLEN + TCP_OPT_MSS_LEN) / 4) << 4;
/* Complete the common portions of the TCP message */