Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2014 20:15:02 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266596 - in head/sys: dev/cxgbe/tom netinet
Message-ID:  <201405232015.s4NKF2Hc030483@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Fri May 23 20:15:01 2014
New Revision: 266596
URL: http://svnweb.freebsd.org/changeset/base/266596

Log:
  Move the tcp_fields_to_host() and tcp_fields_to_net() (inline)
  functions to the tcp_var.h header file in order to avoid further
  duplication with upcoming commits.
  
  Reviewed by:	np
  MFC after:	2 weeks

Modified:
  head/sys/dev/cxgbe/tom/t4_listen.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/dev/cxgbe/tom/t4_listen.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_listen.c	Fri May 23 19:59:14 2014	(r266595)
+++ head/sys/dev/cxgbe/tom/t4_listen.c	Fri May 23 20:15:01 2014	(r266596)
@@ -1052,17 +1052,6 @@ calc_opt2p(struct adapter *sc, struct po
 	return htobe32(opt2);
 }
 
-/* XXX: duplication. */
-static inline void
-tcp_fields_to_host(struct tcphdr *th)
-{
-
-	th->th_seq = ntohl(th->th_seq);
-	th->th_ack = ntohl(th->th_ack);
-	th->th_win = ntohs(th->th_win);
-	th->th_urp = ntohs(th->th_urp);
-}
-
 static void
 pass_accept_req_to_protohdrs(const struct mbuf *m, struct in_conninfo *inc,
     struct tcphdr *th)

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Fri May 23 19:59:14 2014	(r266595)
+++ head/sys/netinet/tcp_input.c	Fri May 23 20:15:01 2014	(r266596)
@@ -455,27 +455,7 @@ cc_post_recovery(struct tcpcb *tp, struc
 	tp->t_bytes_acked = 0;
 }
 
-static inline void
-tcp_fields_to_host(struct tcphdr *th)
-{
-
-	th->th_seq = ntohl(th->th_seq);
-	th->th_ack = ntohl(th->th_ack);
-	th->th_win = ntohs(th->th_win);
-	th->th_urp = ntohs(th->th_urp);
-}
-
 #ifdef TCP_SIGNATURE
-static inline void
-tcp_fields_to_net(struct tcphdr *th)
-{
-
-	th->th_seq = htonl(th->th_seq);
-	th->th_ack = htonl(th->th_ack);
-	th->th_win = htons(th->th_win);
-	th->th_urp = htons(th->th_urp);
-}
-
 static inline int
 tcp_signature_verify_input(struct mbuf *m, int off0, int tlen, int optlen,
     struct tcpopt *to, struct tcphdr *th, u_int tcpbflag)

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Fri May 23 19:59:14 2014	(r266595)
+++ head/sys/netinet/tcp_var.h	Fri May 23 20:15:01 2014	(r266596)
@@ -719,6 +719,27 @@ u_long	 tcp_seq_subtract(u_long, u_long 
 
 void	cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type);
 
+static inline void
+tcp_fields_to_host(struct tcphdr *th)
+{
+
+	th->th_seq = ntohl(th->th_seq);
+	th->th_ack = ntohl(th->th_ack);
+	th->th_win = ntohs(th->th_win);
+	th->th_urp = ntohs(th->th_urp);
+}
+
+#ifdef TCP_SIGNATURE
+static inline void
+tcp_fields_to_net(struct tcphdr *th)
+{
+
+	th->th_seq = htonl(th->th_seq);
+	th->th_ack = htonl(th->th_ack);
+	th->th_win = htons(th->th_win);
+	th->th_urp = htons(th->th_urp);
+}
+#endif
 #endif /* _KERNEL */
 
 #endif /* _NETINET_TCP_VAR_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405232015.s4NKF2Hc030483>