From: angelos Date: Sat, 8 Apr 2000 16:55:58 +0000 (+0000) Subject: If IFF_LINK0 is set, do IP-in-IP instead of Ethernet-in-IP. This will X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ccdbd502fb383d50e3ce7b261180d0dfbefaf2c8;p=openbsd If IFF_LINK0 is set, do IP-in-IP instead of Ethernet-in-IP. This will be used to implement overlay networks and more flexible road-warrior support. --- diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index 60a6d83145e..367428ce125 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_enc.c,v 1.21 2000/03/17 10:25:21 angelos Exp $ */ +/* $OpenBSD: if_enc.c,v 1.22 2000/04/08 16:55:58 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -244,8 +244,11 @@ struct ifnet *ifp; if (m == NULL) /* Empty queue */ return; - /* First, we encapsulate in etherip */ - err = etherip_output(m, tdb, &mp, 0, 0); /* Last 2 args not used */ + /* Encapsulate in etherip or ip-in-ip, depending on interface flag */ + if (ifp->if_flags & IFF_LINK0) + err = ipip_output(m, tdb, &mp, 0, 0); /* Last 2 args not used */ + else + err = etherip_output(m, tdb, &mp, 0, 0); /* Last 2 args not used */ if ((mp == NULL) || err) { /* Just skip this frame */ @@ -265,7 +268,11 @@ struct ifnet *ifp; /* IPsec packet processing -- skip encapsulation */ ipsp_process_packet(m, tdb, protoflag, 1); - /* XXX Should find a way to avoid bridging-loops, some mbuf flag ? */ + /* + * XXX + * Should find a way to avoid bridging/routing-loops, + * perhaps use some mbuf flag ? + */ } #endif /* IPSEC */ }