From 94ac14d2765051a8992c3a822547bc09260492df Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Sat, 12 Nov 2011 04:53:12 +0100 Subject: Rewrote the interface handling. Added full support for kFreeBSD, have not tested with FreeBSD. --- protocol.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'protocol.c') diff --git a/protocol.c b/protocol.c index 43fd6b0..53380d1 100644 --- a/protocol.c +++ b/protocol.c @@ -21,7 +21,9 @@ #include #include #include +#ifdef __LINUX__ #include +#endif #include #include #include @@ -157,10 +159,10 @@ void parse_packet(unsigned char *data, struct mt_mactelnet_hdr *pkthdr) { pkthdr->ptype = data[1]; /* src ethernet addr */ - memcpy(pkthdr->srcaddr, data+2,6); + memcpy(pkthdr->srcaddr, data + 2, ETH_ALEN); /* dst ethernet addr */ - memcpy(pkthdr->dstaddr, data+8,6); + memcpy(pkthdr->dstaddr, data + 8, ETH_ALEN); if (mt_direction_fromserver) { /* Session key */ @@ -168,10 +170,10 @@ void parse_packet(unsigned char *data, struct mt_mactelnet_hdr *pkthdr) { pkthdr->seskey = ntohs(pkthdr->seskey); /* server type */ - memcpy(&(pkthdr->clienttype), data+16, 2); + memcpy(&(pkthdr->clienttype), data + 16, 2); } else { /* server type */ - memcpy(&(pkthdr->clienttype), data+14, 2); + memcpy(&(pkthdr->clienttype), data + 14, 2); /* Session key */ memcpy(&(pkthdr->seskey), data + 16, sizeof(pkthdr->seskey)); -- cgit v1.2.3