chiark / gitweb /
wip log iface
[hippotat.git] / server
diff --git a/server b/server
index f76f501..19a04d2 100755 (executable)
--- a/server
+++ b/server
@@ -16,7 +16,7 @@ clients = { }
 
 #---------- "router" ----------
 
-def route(packet, saddr, daddr):
+def route(packet, iface, saddr, daddr):
   def lt(dest):
     log_debug(DBG.ROUTE, 'route: %s -> %s: %s' % (saddr,daddr,dest), d=packet)
   try: dclient = clients[daddr]
@@ -29,10 +29,10 @@ def route(packet, saddr, daddr):
     queue_inbound(packet)
   elif daddr == relay:
     lt('discard relay')
-    log_discard(packet, saddr, daddr, 'relay')
+    log_discard(packet, iface, saddr, daddr, 'relay')
   else:
     lt('discard no-client')
-    log_discard(packet, saddr, daddr, 'no-client')
+    log_discard(packet, iface, saddr, daddr, 'no-client')
 
 #---------- client ----------
 
@@ -76,7 +76,7 @@ class Client():
       (saddr, daddr) = packet_addrs(packet)
       if saddr != self._ip:
         raise ValueError('wrong source address %s' % saddr)
-      route(packet, saddr, daddr)
+      route(packet, self._ip, saddr, daddr)
 
   def _req_cancel(self, request):
     self._log(DBG.HTTPCTRL, 'cancel', idof=request)