[ros-diffs] [cgutman] 44619: [OSKITTCP] - Add ROS-specific MSS code - We don't mirror our route cache with oskittcp so we can't rely on routes to get the MTU

cgutman at svn.reactos.org cgutman at svn.reactos.org
Wed Dec 16 05:45:44 CET 2009


Author: cgutman
Date: Wed Dec 16 05:45:43 2009
New Revision: 44619

URL: http://svn.reactos.org/svn/reactos?rev=44619&view=rev
Log:
[OSKITTCP]
 - Add ROS-specific MSS code
 - We don't mirror our route cache with oskittcp so we can't rely on routes to get the MTU

Modified:
    branches/aicom-network-branch/lib/drivers/oskittcp/oskittcp/tcp_input.c

Modified: branches/aicom-network-branch/lib/drivers/oskittcp/oskittcp/tcp_input.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/lib/drivers/oskittcp/oskittcp/tcp_input.c?rev=44619&r1=44618&r2=44619&view=diff
==============================================================================
--- branches/aicom-network-branch/lib/drivers/oskittcp/oskittcp/tcp_input.c [iso-8859-1] (original)
+++ branches/aicom-network-branch/lib/drivers/oskittcp/oskittcp/tcp_input.c [iso-8859-1] Wed Dec 16 05:45:43 2009
@@ -1961,7 +1961,14 @@
 
 	inp = tp->t_inpcb;
 	if ((rt = tcp_rtlookup(inp)) == NULL) {
+#ifndef __REACTOS__
 		tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
+#else
+		if (offer < tcp_mssdflt)
+			tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
+		else
+			tp->t_maxopd = tp->t_maxseg = min(offer, tcp_mssopt(tp));
+#endif
 		return;
 	}
 #ifndef __REACTOS__
@@ -2116,15 +2123,20 @@
 tcp_mssopt(tp)
 	struct tcpcb *tp;
 {
+#ifndef __REACTOS__
 	struct rtentry *rt;
 
 	rt = tcp_rtlookup(tp->t_inpcb);
 	if (rt == NULL)
 		return tcp_mssdflt;
-#ifndef __REACTOS__
+
 	return rt->rt_ifp->if_mtu - sizeof(struct tcpiphdr);
 #else
-	return tcp_mssdflt;
+	struct ifaddr *ifa = ifa_ifwithnet((struct sockaddr *)&tp->t_inpcb->inp_faddr);
+	if (ifa == NULL)
+		return tcp_mssdflt;
+
+	return ifa->ifa_mtu - sizeof(struct tcpiphdr);
 #endif
 }
 #endif /* TUBA_INCLUDE */




More information about the Ros-diffs mailing list