diff options
| author | Maxim Sobolev <sobomax@FreeBSD.org> | 2004-01-26 12:33:56 +0000 |
|---|---|---|
| committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2004-01-26 12:33:56 +0000 |
| commit | 7735aeb9bbcba7421aa7be99b311dfeeef21e90d (patch) | |
| tree | 5c5c96b17f9d310360115eac89b4737a0956a175 /sys/net | |
| parent | 9c9fcfa30dbc25e9a68d02748479210ba8c6015b (diff) | |
Notes
Diffstat (limited to 'sys/net')
| -rw-r--r-- | sys/net/if_gre.c | 5 | ||||
| -rw-r--r-- | sys/net/if_gre.h | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 7eb1732c6494..aab706833353 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -178,6 +178,7 @@ gre_clone_create(ifc, unit) sc->sc_if.if_flags |= IFF_LINK0; sc->encap = NULL; sc->called = 0; + sc->wccp_ver = WCCP_V1; if_attach(&sc->sc_if); bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int32_t)); LIST_INSERT_HEAD(&gre_softc_list, sc, sc_list); @@ -407,6 +408,10 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) sc->g_proto = IPPROTO_GRE; else sc->g_proto = IPPROTO_MOBILE; + if ((ifr->ifr_flags & IFF_LINK2) != 0) + sc->wccp_ver = WCCP_V2; + else + sc->wccp_ver = WCCP_V1; goto recompute; case SIOCSIFMTU: if ((error = suser(curthread)) != 0) diff --git a/sys/net/if_gre.h b/sys/net/if_gre.h index 73fed0b89984..21fab39e6160 100644 --- a/sys/net/if_gre.h +++ b/sys/net/if_gre.h @@ -44,6 +44,16 @@ #ifdef _KERNEL #include <sys/queue.h> +/* + * Version of the WCCP, need to be configured manually since + * header for version 2 is the same but IP payload is prepended + * with additional 4-bytes field. + */ +typedef enum { + WCCP_V1 = 0, + WCCP_V2 +} wccp_ver_t; + struct gre_softc { struct ifnet sc_if; LIST_ENTRY(gre_softc) sc_list; @@ -58,6 +68,8 @@ struct gre_softc { const struct encaptab *encap; /* encapsulation cookie */ int called; /* infinite recursion preventer */ + + wccp_ver_t wccp_ver; /* version of the WCCP */ }; |
