--- embedaddon/mpd/src/pppoe.c 2012/02/21 23:32:47 1.1 +++ embedaddon/mpd/src/pppoe.c 2013/07/22 08:44:29 1.1.1.2 @@ -13,6 +13,7 @@ #include "log.h" #include "util.h" +#include #include #include #include @@ -34,7 +35,11 @@ #define ETHER_DEFAULT_HOOK NG_ETHER_HOOK_ORPHAN +#ifndef SMALL_SYSTEM #define PPPOE_MAXPARENTIFS 1024 +#else +#define PPPOE_MAXPARENTIFS 32 +#endif #define MAX_PATH 64 /* XXX should be NG_PATHSIZ */ #define MAX_SESSION 64 /* max length of PPPoE session name */ @@ -587,10 +592,7 @@ PppoePeerMacAddr(Link l, void *buf, size_t buf_len) { PppoeInfo const pppoe = (PppoeInfo)l->info; - snprintf(buf, buf_len, "%02x:%02x:%02x:%02x:%02x:%02x", - pppoe->peeraddr[0], pppoe->peeraddr[1], pppoe->peeraddr[2], - pppoe->peeraddr[3], pppoe->peeraddr[4], pppoe->peeraddr[5]); - + ether_ntoa_r((struct ether_addr *)pppoe->peeraddr, buf); return (0); } @@ -613,9 +615,7 @@ PppoeCallingNum(Link l, void *buf, size_t buf_len) PppoeInfo const pppoe = (PppoeInfo)l->info; if (pppoe->incoming) { - snprintf(buf, buf_len, "%02x%02x%02x%02x%02x%02x", - pppoe->peeraddr[0], pppoe->peeraddr[1], pppoe->peeraddr[2], - pppoe->peeraddr[3], pppoe->peeraddr[4], pppoe->peeraddr[5]); + ether_ntoa_r((struct ether_addr *)pppoe->peeraddr, buf); } else { strlcpy(buf, pppoe->real_session, buf_len); } @@ -629,9 +629,7 @@ PppoeCalledNum(Link l, void *buf, size_t buf_len) PppoeInfo const pppoe = (PppoeInfo)l->info; if (!pppoe->incoming) { - snprintf(buf, buf_len, "%02x%02x%02x%02x%02x%02x", - pppoe->peeraddr[0], pppoe->peeraddr[1], pppoe->peeraddr[2], - pppoe->peeraddr[3], pppoe->peeraddr[4], pppoe->peeraddr[5]); + ether_ntoa_r((struct ether_addr *)pppoe->peeraddr, buf); } else { strlcpy(buf, pppoe->real_session, buf_len); } @@ -677,7 +675,7 @@ CreatePppoeNode(struct PppoeIf *PIf, const char *path, strlcpy(iface, path, sizeof(iface)); if (iface[strlen(iface) - 1] == ':') iface[strlen(iface) - 1] = '\0'; - if (ExecCmdNosh(LG_PHYS2, iface, "%s %s up", PATH_IFCONFIG, iface) != 0) { + if (ExecCmdNosh(LG_PHYS2, iface, "%s %s up", _PATH_IFCONFIG, iface) != 0) { Log(LG_ERR, ("PPPoE: can't bring up interface %s", iface)); return (0);