--- /usr/src/libexec/pppoed/pppoed.c.orig	2012-04-06 20:10:46.000000000 +0400
+++ /usr/src/libexec/pppoed/pppoed.c	2012-04-06 20:28:04.000000000 +0400
@@ -252,7 +252,7 @@
 static void
 Spawn(const char *prog, const char *acname, const char *provider,
       const char *exec, struct ngm_connect ngc, int cs, int ds, void *request,
-      int sz, int debug)
+      int sz, int debug,  const char *iface)
 {
   char msgbuf[sizeof(struct ng_mesg) + sizeof(struct ngpppoe_sts)];
   struct ng_mesg *rep = (struct ng_mesg *)msgbuf;
@@ -262,6 +262,20 @@
   unsigned char *macaddr;
   const char *msg;
   int ret, slen;
+  char *epath;
+
+  epath = (char *)alloca(strlen(iface) + 2);
+  sprintf(epath, "[%s]", iface);
+  /* Put the peer's MAC address in the environment */
+  if (sz >= sizeof(struct ether_header)) {
+    macaddr = ((struct ether_header *)request)->ether_shost;
+    snprintf(env, sizeof(env), "%02x:%02x:%02x:%02x:%02x:%02x",
+     macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4],
+     macaddr[5]);
+  }else{
+    snprintf(env, sizeof(env), "cannot get MAC");
+  }
+  syslog(LOG_INFO, ">>> Received new request from [%s] at %s", env, epath);
 
   switch ((ret = fork())) {
     case -1:
@@ -325,8 +339,8 @@
       strcpy(path, ".:");
       strcpy(path + 2, ngc.ourhook);
 
-      syslog(LOG_INFO, "Offering to %s as access concentrator %s",
-             path, acname);
+      syslog(LOG_INFO, "Offering to %s as access concentrator %s at %s",
+             path, acname, epath);
       if (NgSendMsg(cs, path, NGM_PPPOE_COOKIE, NGM_PPPOE_OFFER,
                     data, sizeof *data + slen) == -1) {
         syslog(LOG_INFO, "%s: Cannot OFFER on netgraph node: %m", path);
@@ -340,8 +354,8 @@
         memcpy(data->data, provider, slen);
         data->data_len = slen;
 
-        syslog(LOG_INFO, "adding to %s as offered service %s",
-             path, acname);
+        syslog(LOG_INFO, "adding to %s as offered service %s at %s",
+             path, acname, epath);
         if (NgSendMsg(cs, path, NGM_PPPOE_COOKIE, NGM_PPPOE_SERVICE,
                     data, sizeof *data + slen) == -1) {
           syslog(LOG_INFO, "%s: Cannot add service on netgraph node: %m", path);
@@ -350,14 +364,9 @@
       }
 
       /* Put the peer's MAC address in the environment */
-      if (sz >= sizeof(struct ether_header)) {
-        macaddr = ((struct ether_header *)request)->ether_shost;
-        snprintf(env, sizeof(env), "%x:%x:%x:%x:%x:%x",
-                 macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4],
-                 macaddr[5]);
         if (setenv(HISMACADDR, env, 1) != 0)
           syslog(LOG_INFO, "setenv: cannot set %s: %m", HISMACADDR);
-      }
+
 
       /* And send our request data to the waiting node */
       if (debug)
@@ -380,7 +389,7 @@
 
         if (ret == 0) {
           /* The socket has been closed */
-          syslog(LOG_INFO, "%s: Client timed out", path);
+          syslog(LOG_INFO, "%s: Client timed out [%s] at %s", path, env, epath);
           _exit(EX_TEMPFAIL);
         }
 
@@ -427,12 +436,12 @@
         switch (rep->header.cmd) {
           case NGM_PPPOE_FAIL:
           case NGM_PPPOE_CLOSE:
-            syslog(LOG_ERR, "Received NGM_PPPOE_%s (hook \"%s\")",
-                   msg, sts->hook);
+            syslog(LOG_ERR, "Received NGM_PPPOE_%s (hook \"%s\") [%s] at %s",
+                   msg, sts->hook, env, epath);
             _exit(0);
         }
 
-        syslog(LOG_INFO, "Received NGM_PPPOE_%s (hook \"%s\")", msg, sts->hook);
+        syslog(LOG_INFO, "Received NGM_PPPOE_%s (hook \"%s\") [%s] at %s", msg, sts->hook, env, epath);
       } while (rep->header.cmd != NGM_PPPOE_SUCCESS);
 
       dup2(ds, STDIN_FILENO);
@@ -441,7 +450,7 @@
       close(cs);
 
       setsid();
-      syslog(LOG_INFO, "Executing: %s", exec);
+      syslog(LOG_INFO, "Executing: %s for %s: [%s] at %s", exec, path, env, epath);
       execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", exec, (char *)NULL);
       syslog(LOG_ERR, "execlp failed: %m");
       _exit(EX_OSFILE);
@@ -645,9 +654,9 @@
 
   while (!ReceivedSignal) {
     if (*provider)
-      syslog(LOG_INFO, "Listening as provider %s", provider);
+      syslog(LOG_INFO, "Listening as provider %s at %s", provider, argv[optind]);
     else
-      syslog(LOG_INFO, "Listening");
+      syslog(LOG_INFO, "Listening as %s", argv[optind]);
 
     switch (sz = NgRecvData(ds, response, sizeof response, rhook)) {
       case -1:
@@ -671,7 +680,7 @@
       ret = EX_UNAVAILABLE;
       break;
     }
-    Spawn(prog, acname, provider, exec, ngc, cs, ds, response, sz, optd);
+    Spawn(prog, acname, provider, exec, ngc, cs, ds, response, sz, optd, argv[optind]);
   }
 
   if (pidfile)
