--- orig/src/SSF/Net/lanLinkLayer.java
+++ mod/src/SSF/Net/lanLinkLayer.java
@@ -52,13 +52,21 @@
     	  if (forLink.dumpTo!=null) forLink.dumpTo.dump(pevt);
 	  int next_hop = ((IpHeader)pevt.getHeaders()).NEXT_HOP_IP;
 	  int dest_ip = ((IpHeader)pevt.getHeaders()).DEST_IP;
-	  outChannel xbar = LAN_OUT[(next_hop==0?dest_ip:next_hop)-forLink.ipaddr];
+	  int effip=next_hop==0?dest_ip:next_hop;
+	  if (effip!=0xffff) {
+	  outChannel xbar = LAN_OUT[effip-forLink.ipaddr];
 	  if (xbar == null) {
 	    System.err.println("** Bad header: LAN dropping "+pevt);
 	  } else {
 	    // System.err.println("LAN forwarding "+pevt+" on "+xbar+" at "+now());
 	    xbar.write(pevt,0);
 	  }
+	  } else {
+	  	for(int i=0;i<LAN_OUT.length;i++)
+			if (LAN_OUT[i]!=null)
+				LAN_OUT[i].write(pevt.save(),0);
+		pevt.release();
+	  }
 	}
 	waitOn(LAN_IN);
       }


--- orig/src/SSF/OS/IP.java
+++ mod/src/SSF/OS/IP.java
@@ -262,7 +262,7 @@
     for (int n=0; !isLocal && n<INTERFACE_COUNT; n++) 
       isLocal = (INTERFACE_SET[n].ipAddr == ipHeader.DEST_IP);
     
-    if (isLocal) { 
+    if (isLocal || ipHeader.NEXT_HOP_IP==0xffff) { 
       ProtocolSession handler = session_cache.demux(ipHeader.PROTOCOL_NO);
       if (handler != null) {
         if (monitorON)
@@ -285,6 +285,12 @@
       drop(ipHeader);
       return false;
     }
+
+	if (ipHeader.DEST_IP==0xffff) {
+		ipHeader.DEST_IP=0;
+		ipHeader.NEXT_HOP_IP=0xffff;
+      return (INTERFACE_SET[0].push(ipHeader,this));
+	}
       
     // 3. If this host is not the destination of this ipHeader, consult 
     //    the forwarding table and send it on the proper network interface.


--- orig/src/SSF/OS/PacketEvent.java
+++ mod/src/SSF/OS/PacketEvent.java
@@ -9,6 +9,10 @@
 public class PacketEvent extends Event {
   private ProtocolMessage pkt;
 
+  public Event save() {
+    return new PacketEvent(pkt.save());
+  }
+
 /** Return the protocol message (the packet headers) inside this PacketEvent.*/
   public ProtocolMessage getHeaders() {
     return pkt;


--- orig/src/SSF/OS/ProtocolMessage.java
+++ mod/src/SSF/OS/ProtocolMessage.java
@@ -6,7 +6,7 @@
   * other ProtocolMessages that represent the previous and subsequent headers.
   * If a subsequent ProtocolMessage exists, it represents the payload of this header.
   */
-public class ProtocolMessage {
+public class ProtocolMessage implements Cloneable {
 
   /** Construct an empty ProtocolMessage. */
   public ProtocolMessage() {
@@ -117,6 +117,18 @@
     // not implemented
   }
 
+  public ProtocolMessage save() {
+  	try {
+  	ProtocolMessage sthis=(ProtocolMessage)clone();
+	if (next!=null) {
+		sthis.next=(ProtocolMessage)next.save();
+		sthis.next.prev=sthis;
+	}
+	return sthis;
+	} catch(CloneNotSupportedException e) {
+	return null;
+	}
+  }
 }
 
 



