Date: Mon, 29 Jan 2007 23:49:38 GMT From: Paolo Pisati <piso@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 113678 for review Message-ID: <200701292349.l0TNncrh060272@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113678 Change 113678 by piso@piso_newluxor on 2007/01/29 23:49:36 Eliminate an usage of ip_next() in alias_proxy.c::ProxyCheck(), and push its usage at an upper layer. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#35 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#12 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#13 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#35 (text+ko) ==== @@ -974,10 +974,11 @@ LIBALIAS_LOCK_ASSERT(la); tc = (struct tcphdr *)ip_next(pip); - + dest_port = tc->th_dport; + if (create) - proxy_type = - ProxyCheck(la, pip, &proxy_server_address, &proxy_server_port); + proxy_type = ProxyCheck(la, pip, &proxy_server_address, + &proxy_server_port, dest_port); else proxy_type = 0; @@ -986,7 +987,6 @@ /* If this is a transparent proxy, save original destination, then alter the destination and adjust checksums */ - dest_port = tc->th_dport; dest_address = pip->ip_dst; if (proxy_type != 0) { int accumulate; ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#12 (text+ko) ==== @@ -321,7 +321,7 @@ /* Transparent proxy routines */ int ProxyCheck(struct libalias *la, struct ip *_pip, struct in_addr *_proxy_server_addr, - u_short * _proxy_server_port); + u_short * _proxy_server_port, u_short dst_port); void ProxyModify(struct libalias *la, struct alias_link *_lnk, struct ip *_pip, int _maxpacketsize, int _proxy_type); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#13 (text+ko) ==== @@ -563,9 +563,8 @@ int ProxyCheck(struct libalias *la, struct ip *pip, struct in_addr *proxy_server_addr, - u_short * proxy_server_port) + u_short * proxy_server_port, u_short dst_port) { - u_short dst_port; struct in_addr src_addr; struct in_addr dst_addr; struct proxy_entry *ptr; @@ -573,8 +572,6 @@ LIBALIAS_LOCK_ASSERT(la); src_addr = pip->ip_src; dst_addr = pip->ip_dst; - dst_port = ((struct tcphdr *)ip_next(pip)) - ->th_dport; ptr = la->proxyList; while (ptr != NULL) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701292349.l0TNncrh060272>