Renaud Allard wrote:
> Markus Friedl wrote:
>> On Fri, Apr 13, 2007 at 12:03:18PM +0200, Renaud Allard wrote:
>>> It's just quite annoying that the man page for brconfig says that the
>>> bridge over gif should work and it does not.
>> well, it did work before and should work in 4.1
>>
>>
>
> I know. But with 4.1, it doesn't work with the config I posted and it
> doesn't work either with 4.1-current of april 6th.
>
>
It works great with the following patch from Markus on a -stable branch:
Index: sys/net/if_bridge.c
===================================================================
RCS file: /cvs/src/sys/net/if_bridge.c,v
retrieving revision 1.158
diff -u -p -u -r1.158 if_bridge.c
--- sys/net/if_bridge.c 10 Apr 2007 17:47:55 -0000 1.158
+++ sys/net/if_bridge.c 16 May 2007 09:03:44 -0000
@@ -2705,6 +2705,11 @@ bridge_ifenqueue(struct bridge_softc *sc
int error, len;
short mflags;
+#if NGIF > 0
+ /* Packet needs etherip encapsulation. */
+ if (ifp->if_type == IFT_GIF)
+ m->m_flags |= M_PROTO1;
+#endif
len = m->m_pkthdr.len;
mflags = m->m_flags;
IFQ_ENQUEUE(&ifp->if_snd, m, NULL, error);
Index: sys/net/if_gif.c
===================================================================
RCS file: /cvs/src/sys/net/if_gif.c,v
retrieving revision 1.43
diff -u -p -u -r1.43 if_gif.c
--- sys/net/if_gif.c 19 Apr 2007 09:28:40 -0000 1.43
+++ sys/net/if_gif.c 16 May 2007 09:03:44 -0000
@@ -217,6 +217,7 @@ gif_start(ifp)
m->m_flags &= ~(M_BCAST|M_MCAST);
/* extract address family */
+ family = AF_UNSPEC;
tp = *mtod(m, u_int8_t *);
tp = (tp >> 4) & 0xff; /* Get the IP version number. */
#ifdef INET
@@ -233,16 +234,10 @@ gif_start(ifp)
* Check if the packet is comming via bridge and needs
* etherip encapsulation or not.
*/
- if (ifp->if_bridge)
- for (mtag = m_tag_find(m, PACKET_TAG_BRIDGE, NULL);
- mtag;
- mtag = m_tag_find(m, PACKET_TAG_BRIDGE, mtag)) {
- if (!bcmp(&ifp->if_bridge, mtag + 1,
- sizeof(caddr_t))) {
- family = AF_LINK;
- break;
- }
- }
+ if (ifp->if_bridge && (m->m_flags & M_PROTO1)) {
+ m->m_flags &= ~M_PROTO1;
+ family = AF_LINK;
+ }
#endif
#if NBPFILTER > 0