[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r16472: {tor} Fix more compile errors on BSD pf stuff. How about now? (in tor/trunk: . src/or)
Author: nickm
Date: 2008-08-07 22:41:34 -0400 (Thu, 07 Aug 2008)
New Revision: 16472
Modified:
tor/trunk/
tor/trunk/src/or/connection_edge.c
Log:
r17692@tombo: nickm | 2008-08-07 22:41:26 -0400
Fix more compile errors on BSD pf stuff. How about now?
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r17692] on 49666b30-7950-49c5-bedf-9dc8f3168102
Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c 2008-08-08 01:05:19 UTC (rev 16471)
+++ tor/trunk/src/or/connection_edge.c 2008-08-08 02:41:34 UTC (rev 16472)
@@ -1714,7 +1714,6 @@
struct sockaddr_storage proxy_addr;
socklen_t proxy_addr_len = sizeof(proxy_addr);
struct sockaddr *proxy_sa = (struct sockaddr*) &proxy_addr;
- char tmpbuf[INET_NTOA_BUF_LEN];
struct pfioc_natlook pnl;
tor_addr_t addr;
int pf = -1;
@@ -1733,17 +1732,17 @@
if (proxy_sa->sa_family == AF_INET) {
struct sockaddr_in *sin = (struct sockaddr_in *)proxy_sa;
pnl.af = AF_INET;
- pnl.saddr.v4.s_addr = tor_addr_to_ipv4n(conn->_base.addr);
+ pnl.saddr.v4.s_addr = tor_addr_to_ipv4n(&conn->_base.addr);
pnl.sport = htons(conn->_base.port);
pnl.daddr.v4.s_addr = sin->sin_addr.s_addr;
pnl.dport = sin->sin_port;
} else if (proxy_sa->sa_family == AF_INET6) {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)proxy_sa;
pnl.af = AF_INET6;
- memcpy(&pnl.saddr.v6, tor_addr_to_in6(conn->_base.addr),
+ memcpy(&pnl.saddr.v6, tor_addr_to_in6(&conn->_base.addr),
sizeof(struct in6_addr));
pnl.sport = htons(conn->_base.port);
- memcpy(&pnl.daddr.v6, &sin6->sin6_addr, siszeof(struct in6_addr));
+ memcpy(&pnl.daddr.v6, &sin6->sin6_addr, sizeof(struct in6_addr));
pnl.dport = sin6->sin6_port;
} else {
log_warn(LD_NET, "getsockname() gave an unexpected address family (%d)",
@@ -1760,16 +1759,16 @@
return -1;
}
- if (pnl->af == AF_INET) {
- tor_addr_from_ipv4n(&addr, &pnl.rdaddr.v4);
- } else if (pnl->af == AF_INET6) {
- tor_addr_from_ipv6_bytes(&addr, &pnl.rdaddr.v6.s6_addr);
+ if (pnl.af == AF_INET) {
+ tor_addr_from_ipv4n(&addr, pnl.rdaddr.v4.s_addr);
+ } else if (pnl.af == AF_INET6) {
+ tor_addr_from_ipv6_bytes(&addr, pnl.rdaddr.v6.s6_addr);
} else {
tor_fragile_assert();
return -1;
}
- tor_addr_to_sring(req->address, &addr, sizeof(req->address), 0);
+ tor_addr_to_string(req->address, &addr, sizeof(req->address), 0);
req->port = ntohs(pnl.rdport);
return 0;