case OVS_VPORT_TYPE_IP6ERSPAN:
return "ip6erspan";
case OVS_VPORT_TYPE_IP6GRE:
+ return "ip6gre";
case OVS_VPORT_TYPE_NETDEV:
case OVS_VPORT_TYPE_INTERNAL:
case OVS_VPORT_TYPE_LISP:
nl_msg_end_nested(&request, linkinfo_off);
err = nl_transact(NETLINK_ROUTE, &request, NULL);
- if (!err && type == OVS_VPORT_TYPE_GRE) {
+ if (!err && (type == OVS_VPORT_TYPE_GRE ||
+ type == OVS_VPORT_TYPE_IP6GRE)) {
/* Work around a bug in kernel GRE driver, which ignores IFLA_MTU in
* RTM_NEWLINK, by setting the MTU again. See
* https://bugzilla.redhat.com/show_bug.cgi?id=1488484. */
return "erspan";
case OVS_VPORT_TYPE_IP6ERSPAN:
- return "ip6erspan";
+ return "ip6erspan";
+
case OVS_VPORT_TYPE_IP6GRE:
- return "";
+ return "ip6gre";
case OVS_VPORT_TYPE_UNSPEC:
case __OVS_VPORT_TYPE_MAX:
return OVS_VPORT_TYPE_ERSPAN;
} else if (!strcmp(type, "ip6erspan")) {
return OVS_VPORT_TYPE_IP6ERSPAN;
+ } else if (!strcmp(type, "ip6gre")) {
+ return OVS_VPORT_TYPE_IP6GRE;
} else {
return OVS_VPORT_TYPE_UNSPEC;
}
hlen = (uint8_t *) options - (uint8_t *) greh;
data->header_len += hlen;
- data->tnl_type = OVS_VPORT_TYPE_GRE;
+ if (!params->is_ipv6) {
+ data->tnl_type = OVS_VPORT_TYPE_GRE;
+ } else {
+ data->tnl_type = OVS_VPORT_TYPE_IP6GRE;
+ }
return 0;
}
}
ersh = ERSPAN_HDR(greh);
- tnl->tun_id = be32_to_be64(be16_to_be32(htons(get_sid(ersh))));
+ tnl->tun_id = be16_to_be64(htons(get_sid(ersh)));
tnl->erspan_ver = ersh->ver;
if (ersh->ver == 1) {
netdev_erspan_push_header,
netdev_erspan_pop_header,
NULL),
+ TUNNEL_CLASS("ip6gre", "ip6gre_sys", netdev_gre_build_header,
+ netdev_gre_push_header,
+ netdev_gre_pop_header,
+ NULL),
};
static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
}
ds_put_char(ds, ')');
- } else if (data->tnl_type == OVS_VPORT_TYPE_GRE) {
+ } else if (data->tnl_type == OVS_VPORT_TYPE_GRE ||
+ data->tnl_type == OVS_VPORT_TYPE_IP6GRE) {
const struct gre_base_hdr *greh;
ovs_16aligned_be32 *options;
} else if (ovs_scan_len(s, &n, "gre((flags=0x%"SCNx16",proto=0x%"SCNx16")",
&gre_flags, &gre_proto)){
- tnl_type = OVS_VPORT_TYPE_GRE;
+ if (eth->eth_type == htons(ETH_TYPE_IP)) {
+ tnl_type = OVS_VPORT_TYPE_GRE;
+ } else {
+ tnl_type = OVS_VPORT_TYPE_IP6GRE;
+ }
greh->flags = htons(gre_flags);
greh->protocol = htons(gre_proto);
ovs_16aligned_be32 *options = (ovs_16aligned_be32 *) (greh + 1);
return IPPROTO_TCP;
}
if (!strcmp(type, "gre") || !strcmp(type, "erspan") ||
- !strcmp(type, "ip6erspan")) {
+ !strcmp(type, "ip6erspan") || !strcmp(type, "ip6gre")) {
return IPPROTO_GRE;
}
if (!strcmp(type, "vxlan")) {