-/* $OpenBSD: if_gre.c,v 1.116 2018/02/27 06:16:23 dlg Exp $ */
+/* $OpenBSD: if_gre.c,v 1.117 2018/02/27 06:46:00 dlg Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
#define GRE_WCCP 0x883e
+#define GRE_HDRLEN (sizeof(struct ip) + sizeof(struct gre_header))
+
/*
* GRE tunnel metadata
*/
ifp = &sc->sc_if;
ifp->if_softc = sc;
ifp->if_type = IFT_TUNNEL;
- ifp->if_hdrlen = 24; /* IP + GRE */
+ ifp->if_hdrlen = GRE_HDRLEN;
ifp->if_mtu = GREMTU;
ifp->if_flags = IFF_POINTOPOINT|IFF_MULTICAST;
ifp->if_xflags = IFXF_CLONED;
ifp->if_softc = sc;
ifp->if_type = IFT_L3IPVLAN;
- ifp->if_hdrlen = 24; /* IP + GRE */
+ ifp->if_hdrlen = GRE_HDRLEN;
ifp->if_mtu = GREMTU;
ifp->if_flags = 0; /* it's not p2p, and can't mcast or bcast */
ifp->if_xflags = IFXF_CLONED;
NET_ASSERT_LOCKED();
CLR(sc->sc_if.if_flags, IFF_RUNNING);
- sc->sc_if.if_hdrlen = 24; /* symmetry */
+ sc->sc_if.if_hdrlen = GRE_HDRLEN; /* symmetry */
RBT_REMOVE(mgre_tree, &mgre_tree, sc);