summaryrefslogtreecommitdiff
path: root/econfind.c
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-03-13 13:04:54 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-03-13 13:15:51 +0100
commit3f0dfe5fbb4f8217fe6e022fdf41a361f3a1cf8c (patch)
treece88c081521d096a96c46ec4530173182cd1ac3a /econfind.c
parentc86a48ce405f5aa8911ffb290c3e0d03077b5cae (diff)
downloadecon-3f0dfe5fbb4f8217fe6e022fdf41a361f3a1cf8c.tar.gz
econ-3f0dfe5fbb4f8217fe6e022fdf41a361f3a1cf8c.tar.bz2
econ-3f0dfe5fbb4f8217fe6e022fdf41a361f3a1cf8c.zip
econfind: Beamer IP has to be optained from recvmsg directly
The econ_header IPaddress field holds only our client ip. econpacket needs to store the addr in the packet.
Diffstat (limited to 'econfind.c')
-rw-r--r--econfind.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/econfind.c b/econfind.c
index 29f9651..c806446 100644
--- a/econfind.c
+++ b/econfind.c
@@ -30,10 +30,12 @@
static void
parse_clientinfo(struct econ_packet *pkt)
{
- struct in_addr beamer;
-
- beamer.s_addr = *(uint32_t*)pkt->hdr.IPaddress;
- printf("%s", inet_ntoa(beamer));
+ /* Clientinfo has our ip in the packet header,
+ * and the record has the ip 16.0.32.0,
+ * none of them are the acutal beamer ip,
+ * so we retreive that from the up packet directly. */
+ printf("%s", inet_ntoa(pkt->addr.sin_addr));
+
if (pkt->hdr.datasize > 0) {
char *name = pkt->cmd.command.clientinfo.projName;
int state = pkt->cmd.command.clientinfo.projState;