summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-13 11:47:42 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-13 11:47:42 +0100
commit0590256080feb5e8f8742938efa539f2aec90601 (patch)
tree933ba6f741d4e4b667afc912b7503e723deaad6a /proc.c
parent1a8612c18833b3ee9ff07b28533408f2e45fddfd (diff)
fix local/remote port env vars
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 191579f..d24649f 100644
--- a/proc.c
+++ b/proc.c
@@ -147,7 +147,9 @@ struct env_var *uh_get_process_vars(struct client *cl, struct path_info *pi)
snprintf(redirect_status, sizeof(redirect_status),
"%d", req->redirect_status);
inet_ntop(cl->srv_addr.family, &cl->srv_addr.in, local_addr, sizeof(local_addr));
+ snprintf(local_port, sizeof(local_port), "%d", cl->srv_addr.port);
inet_ntop(cl->peer_addr.family, &cl->peer_addr.in, remote_addr, sizeof(remote_addr));
+ snprintf(remote_port, sizeof(remote_port), "%d", cl->peer_addr.port);
blobmsg_parse(hdr_policy, __HDR_MAX, tb, blob_data(data), blob_len(data));
for (i = 0; i < ARRAY_SIZE(proc_header_env); i++) {