X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/d5c6f842712c3772a9de56214e312af9174e4207..11996ba4147678c1d400dcc16e33d83a9a3ede9c:/util.c?ds=inline diff --git a/util.c b/util.c index 0ab1d92..d4dbd4f 100644 --- a/util.c +++ b/util.c @@ -28,6 +28,17 @@ char *fmtaddr(in_addr_t addr, int n) return strcpy(addrs[n], inet_ntoa(in)); } +char *fmtMacAddr(uint8_t *pMacAddr) +{ + static char strMAC[2*ETH_ALEN]; + + sprintf(strMAC, "%02X:%02X:%02X:%02X:%02X:%02X", + pMacAddr[0], pMacAddr[1], pMacAddr[2], + pMacAddr[3], pMacAddr[4], pMacAddr[5]); + + return strMAC; +} + void *shared_malloc(unsigned int size) { void * p; @@ -79,8 +90,6 @@ pid_t fork_and_close() if (controlfd != -1) close(controlfd); if (daefd != -1) close(daefd); if (snoopfd != -1) close(snoopfd); - if (ifrfd != -1) close(ifrfd); - if (ifr6fd != -1) close(ifr6fd); if (rand_fd != -1) close(rand_fd); if (epollfd != -1) close(epollfd);