From owner-svn-src-all@FreeBSD.ORG Mon Nov 25 22:55:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DA74BDF; Mon, 25 Nov 2013 22:55:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4AE200F; Mon, 25 Nov 2013 22:55:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAPMt7Iv073774; Mon, 25 Nov 2013 22:55:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAPMt64a073772; Mon, 25 Nov 2013 22:55:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201311252255.rAPMt64a073772@svn.freebsd.org> From: Adrian Chadd Date: Mon, 25 Nov 2013 22:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258605 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2013 22:55:07 -0000 Author: adrian Date: Mon Nov 25 22:55:06 2013 New Revision: 258605 URL: http://svnweb.freebsd.org/changeset/base/258605 Log: Convert over the TCP probes to use mtod() rather than directly dereferencing m->m_data. Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Nov 25 22:37:36 2013 (r258604) +++ head/sys/netinet/tcp_input.c Mon Nov 25 22:55:06 2013 (r258605) @@ -1393,7 +1393,7 @@ relocked: } #endif - TCP_PROBE5(receive, NULL, tp, m->m_data, tp, th); + TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); /* * Segment belongs to a connection in SYN_SENT, ESTABLISHED or later @@ -1405,7 +1405,7 @@ relocked: return; dropwithreset: - TCP_PROBE5(receive, NULL, tp, m->m_data, tp, th); + TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); if (ti_locked == TI_WLOCKED) { INP_INFO_WUNLOCK(&V_tcbinfo); @@ -1429,7 +1429,7 @@ dropwithreset: dropunlock: if (m != NULL) - TCP_PROBE5(receive, NULL, tp, m->m_data, tp, th); + TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); if (ti_locked == TI_WLOCKED) { INP_INFO_WUNLOCK(&V_tcbinfo); @@ -1928,8 +1928,8 @@ tcp_do_segment(struct mbuf *m, struct tc goto dropwithreset; } if ((thflags & (TH_ACK|TH_RST)) == (TH_ACK|TH_RST)) { - TCP_PROBE5(connect_refused, NULL, tp, m->m_data, tp, - th); + TCP_PROBE5(connect_refused, NULL, tp, + mtod(m, const char *), tp, th); tp = tcp_drop(tp, ECONNREFUSED); } if (thflags & TH_RST) @@ -1982,7 +1982,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(connect_established, NULL, tp, - m->m_data, tp, th); + mtod(m, const char *), tp, th); cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); @@ -2387,8 +2387,8 @@ tcp_do_segment(struct mbuf *m, struct tc tp->t_flags &= ~TF_NEEDFIN; } else { tcp_state_change(tp, TCPS_ESTABLISHED); - TCP_PROBE5(accept_established, NULL, tp, m->m_data, tp, - th); + TCP_PROBE5(accept_established, NULL, tp, + mtod(m, const char *), tp, th); cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Nov 25 22:37:36 2013 (r258604) +++ head/sys/netinet/tcp_subr.c Mon Nov 25 22:55:06 2013 (r258605) @@ -720,9 +720,10 @@ tcp_respond(struct tcpcb *tp, void *ipge tcp_trace(TA_OUTPUT, 0, tp, mtod(m, void *), th, 0); #endif if (flags & TH_RST) - TCP_PROBE5(accept_refused, NULL, NULL, m->m_data, tp, nth); + TCP_PROBE5(accept_refused, NULL, NULL, mtod(m, const char *), + tp, nth); - TCP_PROBE5(send, NULL, tp, m->m_data, tp, nth); + TCP_PROBE5(send, NULL, tp, mtod(m, const char *), tp, nth); #ifdef INET6 if (isipv6) (void) ip6_output(m, NULL, NULL, ipflags, NULL, NULL, inp);