diff options
author | des <des@FreeBSD.org> | 2004-07-05 11:10:57 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-07-05 11:10:57 +0000 |
commit | 75b8ca22865b39326d190287e3fba668f2bc9c69 (patch) | |
tree | 77fa5223deb526198fa337db00a3d819bbd0caf9 /lib/libalias/alias_proxy.c | |
parent | 831b8f89dbfee234b02272af07d46aa93a33579c (diff) | |
download | FreeBSD-src-75b8ca22865b39326d190287e3fba668f2bc9c69.zip FreeBSD-src-75b8ca22865b39326d190287e3fba668f2bc9c69.tar.gz |
Make libalias WARNS?=6-clean. This mostly involves renaming variables
named link, foo_link or link_foo to lnk, foo_lnk or lnk_foo, fixing
signed / unsigned comparisons, and shoving unused function arguments
under the carpet.
I was hoping WARNS?=6 might reveal more serious problems, and perhaps
the source of the -O2 breakage, but found no smoking gun.
Diffstat (limited to 'lib/libalias/alias_proxy.c')
-rw-r--r-- | lib/libalias/alias_proxy.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/libalias/alias_proxy.c b/lib/libalias/alias_proxy.c index 70e0a15..24d8bfee7 100644 --- a/lib/libalias/alias_proxy.c +++ b/lib/libalias/alias_proxy.c @@ -274,7 +274,7 @@ RuleNumberDelete(struct libalias *la, int rule_index) } static void -ProxyEncodeTcpStream(struct alias_link *link, +ProxyEncodeTcpStream(struct alias_link *lnk, struct ip *pip, int maxpacketsize) { @@ -287,12 +287,12 @@ ProxyEncodeTcpStream(struct alias_link *link, /* Don't modify if once already modified */ - if (GetAckModified(link)) + if (GetAckModified(lnk)) return; /* Translate destination address and port to string form */ snprintf(buffer, sizeof(buffer) - 2, "[DEST %s %d]", - inet_ntoa(GetProxyAddress(link)), (u_int) ntohs(GetProxyPort(link))); + inet_ntoa(GetProxyAddress(lnk)), (u_int) ntohs(GetProxyPort(lnk))); /* Pad string out to a multiple of two in length */ slen = strlen(buffer); @@ -307,7 +307,7 @@ ProxyEncodeTcpStream(struct alias_link *link, } /* Check for packet overflow */ - if ((ntohs(pip->ip_len) + strlen(buffer)) > maxpacketsize) + if ((int)(ntohs(pip->ip_len) + strlen(buffer)) > maxpacketsize) return; /* Shift existing TCP data and insert destination string */ @@ -335,9 +335,9 @@ ProxyEncodeTcpStream(struct alias_link *link, { int delta; - SetAckModified(link); - delta = GetDeltaSeqOut(pip, link); - AddSeq(pip, link, delta + slen); + SetAckModified(lnk); + delta = GetDeltaSeqOut(pip, lnk); + AddSeq(pip, lnk, delta + slen); } /* Update IP header packet length and checksum */ @@ -372,6 +372,8 @@ ProxyEncodeIpHeader(struct ip *pip, fprintf(stdout, "tcp cksum 1 = %x\n", (u_int) TcpChecksum(pip)); #endif + (void)maxpacketsize; + /* Check to see that there is room to add an IP option */ if (pip->ip_hl > (0x0f - OPTION_LEN_INT32)) return; @@ -481,18 +483,21 @@ ProxyCheck(struct libalias *la, struct ip *pip, } void -ProxyModify(struct libalias *la, struct alias_link *link, +ProxyModify(struct libalias *la, struct alias_link *lnk, struct ip *pip, int maxpacketsize, int proxy_type) { + + (void)la; + switch (proxy_type) { case PROXY_TYPE_ENCODE_IPHDR: ProxyEncodeIpHeader(pip, maxpacketsize); break; case PROXY_TYPE_ENCODE_TCPSTREAM: - ProxyEncodeTcpStream(link, pip, maxpacketsize); + ProxyEncodeTcpStream(lnk, pip, maxpacketsize); break; } } @@ -549,7 +554,7 @@ LibAliasProxyRule(struct libalias *la, const char *cmd) /* Copy command line into a buffer */ cmd += strspn(cmd, " \t"); cmd_len = strlen(cmd); - if (cmd_len > (sizeof(buffer) - 1)) + if (cmd_len > (int)(sizeof(buffer) - 1)) return (-1); strcpy(buffer, cmd); |