From patchwork Thu Mar 17 19:17:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 599221 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qQymj01g2z9sdQ for ; Fri, 18 Mar 2016 06:17:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933706AbcCQTRz (ORCPT ); Thu, 17 Mar 2016 15:17:55 -0400 Received: from nbfkord-smmo04.seg.att.com ([209.65.160.86]:21680 "EHLO nbfkord-smmo04.seg.att.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932452AbcCQTRx (ORCPT ); Thu, 17 Mar 2016 15:17:53 -0400 Received: from unknown [193.34.186.16] by nbfkord-smmo04.seg.att.com(mxl_mta-7.2.4-6) with SMTP id 0e20be65.0.505200.00-2381.1257341.nbfkord-smmo04.seg.att.com (envelope-from ); Thu, 17 Mar 2016 19:17:53 +0000 (UTC) X-MXL-Hash: 56eb02e11d819e43-ead1e14adab924a1fe435e339d5862222b69d42d Received: from ec-desktop.uk.level5networks.com (10.17.20.45) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 17 Mar 2016 19:17:19 +0000 From: Edward Cree Subject: [PATCH v2 ethtool 1/2] Add IPv6 support to NFC To: Ben Hutchings References: <56EB00D6.3060003@solarflare.com> CC: Message-ID: <56EB02BC.8070405@solarflare.com> Date: Thu, 17 Mar 2016 19:17:16 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <56EB00D6.3060003@solarflare.com> X-Originating-IP: [10.17.20.45] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.000.1202-22198.003 X-TM-AS-Result: No--4.843700-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-AnalysisOut: [v=2.0 cv=atUF/1lV c=1 sm=1 a=8P+NB+fYZDP74ap4g4d9Kw==:17 a] X-AnalysisOut: [=fVG4DLb5TBsA:10 a=7OsogOcEt9IA:10 a=zRKbQ67AAAAA:8 a=sC96] X-AnalysisOut: [uHroG_WgR1TjI7EA:9 a=QEXdDO2ut3YA:10] X-Spam: [F=0.4601510147; CM=0.500; S=0.460(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [193.34.186.16] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Edward Cree --- ethtool.c | 21 +++++ rxclass.c | 267 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 274 insertions(+), 14 deletions(-) diff --git a/ethtool.c b/ethtool.c index 0cd0d4f..b476dcc 100644 --- a/ethtool.c +++ b/ethtool.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -3540,6 +3541,22 @@ static int do_permaddr(struct cmd_context *ctx) return err; } +static bool flow_type_is_ntuple_supported(__u32 flow_type) +{ + switch (flow_type) { + case TCP_V4_FLOW: + case UDP_V4_FLOW: + case SCTP_V4_FLOW: + case AH_V4_FLOW: + case ESP_V4_FLOW: + case IPV4_USER_FLOW: + case ETHER_FLOW: + return true; + default: + return false; + } +} + static int flow_spec_to_ntuple(struct ethtool_rx_flow_spec *fsp, struct ethtool_rx_ntuple_flow_spec *ntuple) { @@ -3563,6 +3580,10 @@ static int flow_spec_to_ntuple(struct ethtool_rx_flow_spec *fsp, fsp->m_ext.vlan_etype) return -1; + /* IPv6 flow types are not supported by ntuple */ + if (!flow_type_is_ntuple_supported(fsp->flow_type & ~FLOW_EXT)) + return -1; + /* Set entire ntuple to ~0 to guarantee all masks are set */ memset(ntuple, ~0, sizeof(*ntuple)); diff --git a/rxclass.c b/rxclass.c index cd686a3..c7bfeba 100644 --- a/rxclass.c +++ b/rxclass.c @@ -39,6 +39,25 @@ static void rxclass_print_ipv4_rule(__be32 sip, __be32 sipm, __be32 dip, tos, tosm); } +static void rxclass_print_ipv6_rule(__be32 *sip, __be32 *sipm, __be32 *dip, + __be32 *dipm, u8 tclass, u8 tclassm) +{ + char sip_str[INET6_ADDRSTRLEN]; + char sipm_str[INET6_ADDRSTRLEN]; + char dip_str[INET6_ADDRSTRLEN]; + char dipm_str[INET6_ADDRSTRLEN]; + + fprintf(stdout, + "\tSrc IP addr: %s mask: %s\n" + "\tDest IP addr: %s mask: %s\n" + "\tTraffic Class: 0x%x mask: 0x%x\n", + inet_ntop(AF_INET6, sip, sip_str, INET6_ADDRSTRLEN), + inet_ntop(AF_INET6, sipm, sipm_str, INET6_ADDRSTRLEN), + inet_ntop(AF_INET6, dip, dip_str, INET6_ADDRSTRLEN), + inet_ntop(AF_INET6, dipm, dipm_str, INET6_ADDRSTRLEN), + tclass, tclassm); +} + static void rxclass_print_nfc_spec_ext(struct ethtool_rx_flow_spec *fsp) { if (fsp->flow_type & FLOW_EXT) { @@ -127,7 +146,7 @@ static void rxclass_print_nfc_rule(struct ethtool_rx_flow_spec *fsp) ntohl(fsp->h_u.esp_ip4_spec.spi), ntohl(fsp->m_u.esp_ip4_spec.spi)); break; - case IP_USER_FLOW: + case IPV4_USER_FLOW: fprintf(stdout, "\tRule Type: Raw IPv4\n"); rxclass_print_ipv4_rule(fsp->h_u.usr_ip4_spec.ip4src, fsp->m_u.usr_ip4_spec.ip4src, @@ -143,6 +162,62 @@ static void rxclass_print_nfc_rule(struct ethtool_rx_flow_spec *fsp) ntohl(fsp->h_u.usr_ip4_spec.l4_4_bytes), ntohl(fsp->m_u.usr_ip4_spec.l4_4_bytes)); break; + case TCP_V6_FLOW: + case UDP_V6_FLOW: + case SCTP_V6_FLOW: + if (flow_type == TCP_V6_FLOW) + fprintf(stdout, "\tRule Type: TCP over IPv6\n"); + else if (flow_type == UDP_V6_FLOW) + fprintf(stdout, "\tRule Type: UDP over IPv6\n"); + else + fprintf(stdout, "\tRule Type: SCTP over IPv6\n"); + rxclass_print_ipv6_rule(fsp->h_u.tcp_ip6_spec.ip6src, + fsp->m_u.tcp_ip6_spec.ip6src, + fsp->h_u.tcp_ip6_spec.ip6dst, + fsp->m_u.tcp_ip6_spec.ip6dst, + fsp->h_u.tcp_ip6_spec.tclass, + fsp->m_u.tcp_ip6_spec.tclass); + fprintf(stdout, + "\tSrc port: %d mask: 0x%x\n" + "\tDest port: %d mask: 0x%x\n", + ntohs(fsp->h_u.tcp_ip6_spec.psrc), + ntohs(fsp->m_u.tcp_ip6_spec.psrc), + ntohs(fsp->h_u.tcp_ip6_spec.pdst), + ntohs(fsp->m_u.tcp_ip6_spec.pdst)); + break; + case AH_V6_FLOW: + case ESP_V6_FLOW: + if (flow_type == AH_V6_FLOW) + fprintf(stdout, "\tRule Type: IPSEC AH over IPv6\n"); + else + fprintf(stdout, "\tRule Type: IPSEC ESP over IPv6\n"); + rxclass_print_ipv6_rule(fsp->h_u.ah_ip6_spec.ip6src, + fsp->m_u.ah_ip6_spec.ip6src, + fsp->h_u.ah_ip6_spec.ip6dst, + fsp->m_u.ah_ip6_spec.ip6dst, + fsp->h_u.ah_ip6_spec.tclass, + fsp->m_u.ah_ip6_spec.tclass); + fprintf(stdout, + "\tSPI: %d mask: 0x%x\n", + ntohl(fsp->h_u.esp_ip6_spec.spi), + ntohl(fsp->m_u.esp_ip6_spec.spi)); + break; + case IPV6_USER_FLOW: + fprintf(stdout, "\tRule Type: Raw IPv6\n"); + rxclass_print_ipv6_rule(fsp->h_u.usr_ip6_spec.ip6src, + fsp->m_u.usr_ip6_spec.ip6src, + fsp->h_u.usr_ip6_spec.ip6dst, + fsp->m_u.usr_ip6_spec.ip6dst, + fsp->h_u.usr_ip6_spec.tclass, + fsp->m_u.usr_ip6_spec.tclass); + fprintf(stdout, + "\tProtocol: %d mask: 0x%x\n" + "\tL4 bytes: 0x%x mask: 0x%x\n", + fsp->h_u.usr_ip6_spec.l4_proto, + fsp->m_u.usr_ip6_spec.l4_proto, + ntohl(fsp->h_u.usr_ip6_spec.l4_4_bytes), + ntohl(fsp->m_u.usr_ip6_spec.l4_4_bytes)); + break; case ETHER_FLOW: dmac = fsp->h_u.ether_spec.h_dest; dmacm = fsp->m_u.ether_spec.h_dest; @@ -190,21 +265,20 @@ static void rxclass_print_rule(struct ethtool_rx_flow_spec *fsp) case SCTP_V4_FLOW: case AH_V4_FLOW: case ESP_V4_FLOW: - case ETHER_FLOW: - rxclass_print_nfc_rule(fsp); - break; - case IP_USER_FLOW: - if (fsp->h_u.usr_ip4_spec.ip_ver == ETH_RX_NFC_IP4) { - rxclass_print_nfc_rule(fsp); - break; - } - /* IPv6 User Flow falls through to the case below */ case TCP_V6_FLOW: case UDP_V6_FLOW: case SCTP_V6_FLOW: case AH_V6_FLOW: case ESP_V6_FLOW: - fprintf(stderr, "IPv6 flows not implemented\n"); + case IPV6_USER_FLOW: + case ETHER_FLOW: + rxclass_print_nfc_rule(fsp); + break; + case IPV4_USER_FLOW: + if (fsp->h_u.usr_ip4_spec.ip_ver == ETH_RX_NFC_IP4) + rxclass_print_nfc_rule(fsp); + else /* IPv6 uses IPV6_USER_FLOW */ + fprintf(stderr, "IPV4_USER_FLOW with wrong ip_ver\n"); break; default: fprintf(stderr, "rxclass: Unknown flow type\n"); @@ -530,6 +604,7 @@ typedef enum { OPT_BE32, OPT_BE64, OPT_IP4, + OPT_IP6, OPT_MAC, } rule_opt_type_t; @@ -663,6 +738,114 @@ static const struct rule_opts rule_nfc_usr_ip4[] = { offsetof(struct ethtool_rx_flow_spec, m_ext.h_dest) }, }; +static const struct rule_opts rule_nfc_tcp_ip6[] = { + { "src-ip", OPT_IP6, NFC_FLAG_SADDR, + offsetof(struct ethtool_rx_flow_spec, h_u.tcp_ip6_spec.ip6src), + offsetof(struct ethtool_rx_flow_spec, m_u.tcp_ip6_spec.ip6src) }, + { "dst-ip", OPT_IP6, NFC_FLAG_DADDR, + offsetof(struct ethtool_rx_flow_spec, h_u.tcp_ip6_spec.ip6dst), + offsetof(struct ethtool_rx_flow_spec, m_u.tcp_ip6_spec.ip6dst) }, + { "tclass", OPT_U8, NFC_FLAG_TOS, + offsetof(struct ethtool_rx_flow_spec, h_u.tcp_ip6_spec.tclass), + offsetof(struct ethtool_rx_flow_spec, m_u.tcp_ip6_spec.tclass) }, + { "src-port", OPT_BE16, NFC_FLAG_SPORT, + offsetof(struct ethtool_rx_flow_spec, h_u.tcp_ip6_spec.psrc), + offsetof(struct ethtool_rx_flow_spec, m_u.tcp_ip6_spec.psrc) }, + { "dst-port", OPT_BE16, NFC_FLAG_DPORT, + offsetof(struct ethtool_rx_flow_spec, h_u.tcp_ip6_spec.pdst), + offsetof(struct ethtool_rx_flow_spec, m_u.tcp_ip6_spec.pdst) }, + { "action", OPT_U64, NFC_FLAG_RING, + offsetof(struct ethtool_rx_flow_spec, ring_cookie), -1 }, + { "loc", OPT_U32, NFC_FLAG_LOC, + offsetof(struct ethtool_rx_flow_spec, location), -1 }, + { "vlan-etype", OPT_BE16, NTUPLE_FLAG_VETH, + offsetof(struct ethtool_rx_flow_spec, h_ext.vlan_etype), + offsetof(struct ethtool_rx_flow_spec, m_ext.vlan_etype) }, + { "vlan", OPT_BE16, NTUPLE_FLAG_VLAN, + offsetof(struct ethtool_rx_flow_spec, h_ext.vlan_tci), + offsetof(struct ethtool_rx_flow_spec, m_ext.vlan_tci) }, + { "user-def", OPT_BE64, NTUPLE_FLAG_UDEF, + offsetof(struct ethtool_rx_flow_spec, h_ext.data), + offsetof(struct ethtool_rx_flow_spec, m_ext.data) }, + { "dst-mac", OPT_MAC, NFC_FLAG_MAC_ADDR, + offsetof(struct ethtool_rx_flow_spec, h_ext.h_dest), + offsetof(struct ethtool_rx_flow_spec, m_ext.h_dest) }, +}; + +static const struct rule_opts rule_nfc_esp_ip6[] = { + { "src-ip", OPT_IP6, NFC_FLAG_SADDR, + offsetof(struct ethtool_rx_flow_spec, h_u.esp_ip6_spec.ip6src), + offsetof(struct ethtool_rx_flow_spec, m_u.esp_ip6_spec.ip6src) }, + { "dst-ip", OPT_IP6, NFC_FLAG_DADDR, + offsetof(struct ethtool_rx_flow_spec, h_u.esp_ip6_spec.ip6dst), + offsetof(struct ethtool_rx_flow_spec, m_u.esp_ip6_spec.ip6dst) }, + { "tclass", OPT_U8, NFC_FLAG_TOS, + offsetof(struct ethtool_rx_flow_spec, h_u.esp_ip6_spec.tclass), + offsetof(struct ethtool_rx_flow_spec, m_u.esp_ip6_spec.tclass) }, + { "spi", OPT_BE32, NFC_FLAG_SPI, + offsetof(struct ethtool_rx_flow_spec, h_u.esp_ip6_spec.spi), + offsetof(struct ethtool_rx_flow_spec, m_u.esp_ip6_spec.spi) }, + { "action", OPT_U64, NFC_FLAG_RING, + offsetof(struct ethtool_rx_flow_spec, ring_cookie), -1 }, + { "loc", OPT_U32, NFC_FLAG_LOC, + offsetof(struct ethtool_rx_flow_spec, location), -1 }, + { "vlan-etype", OPT_BE16, NTUPLE_FLAG_VETH, + offsetof(struct ethtool_rx_flow_spec, h_ext.vlan_etype), + offsetof(struct ethtool_rx_flow_spec, m_ext.vlan_etype) }, + { "vlan", OPT_BE16, NTUPLE_FLAG_VLAN, + offsetof(struct ethtool_rx_flow_spec, h_ext.vlan_tci), + offsetof(struct ethtool_rx_flow_spec, m_ext.vlan_tci) }, + { "user-def", OPT_BE64, NTUPLE_FLAG_UDEF, + offsetof(struct ethtool_rx_flow_spec, h_ext.data), + offsetof(struct ethtool_rx_flow_spec, m_ext.data) }, + { "dst-mac", OPT_MAC, NFC_FLAG_MAC_ADDR, + offsetof(struct ethtool_rx_flow_spec, h_ext.h_dest), + offsetof(struct ethtool_rx_flow_spec, m_ext.h_dest) }, +}; + +static const struct rule_opts rule_nfc_usr_ip6[] = { + { "src-ip", OPT_IP6, NFC_FLAG_SADDR, + offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip6_spec.ip6src), + offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip6_spec.ip6src) }, + { "dst-ip", OPT_IP6, NFC_FLAG_DADDR, + offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip6_spec.ip6dst), + offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip6_spec.ip6dst) }, + { "tclass", OPT_U8, NFC_FLAG_TOS, + offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip6_spec.tclass), + offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip6_spec.tclass) }, + { "l4proto", OPT_U8, NFC_FLAG_PROTO, + offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip6_spec.l4_proto), + offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip6_spec.l4_proto) }, + { "l4data", OPT_BE32, NFC_FLAG_SPI, + offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip6_spec.l4_4_bytes), + offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip6_spec.l4_4_bytes) }, + { "spi", OPT_BE32, NFC_FLAG_SPI, + offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip6_spec.l4_4_bytes), + offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip6_spec.l4_4_bytes) }, + { "src-port", OPT_BE16, NFC_FLAG_SPORT, + offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip6_spec.l4_4_bytes), + offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip6_spec.l4_4_bytes) }, + { "dst-port", OPT_BE16, NFC_FLAG_DPORT, + offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip6_spec.l4_4_bytes) + 2, + offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip6_spec.l4_4_bytes) + 2 }, + { "action", OPT_U64, NFC_FLAG_RING, + offsetof(struct ethtool_rx_flow_spec, ring_cookie), -1 }, + { "loc", OPT_U32, NFC_FLAG_LOC, + offsetof(struct ethtool_rx_flow_spec, location), -1 }, + { "vlan-etype", OPT_BE16, NTUPLE_FLAG_VETH, + offsetof(struct ethtool_rx_flow_spec, h_ext.vlan_etype), + offsetof(struct ethtool_rx_flow_spec, m_ext.vlan_etype) }, + { "vlan", OPT_BE16, NTUPLE_FLAG_VLAN, + offsetof(struct ethtool_rx_flow_spec, h_ext.vlan_tci), + offsetof(struct ethtool_rx_flow_spec, m_ext.vlan_tci) }, + { "user-def", OPT_BE64, NTUPLE_FLAG_UDEF, + offsetof(struct ethtool_rx_flow_spec, h_ext.data), + offsetof(struct ethtool_rx_flow_spec, m_ext.data) }, + { "dst-mac", OPT_MAC, NFC_FLAG_MAC_ADDR, + offsetof(struct ethtool_rx_flow_spec, h_ext.h_dest), + offsetof(struct ethtool_rx_flow_spec, m_ext.h_dest) }, +}; + static const struct rule_opts rule_nfc_ether[] = { { "src", OPT_MAC, NFC_FLAG_SADDR, offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_source), @@ -726,6 +909,14 @@ static int rxclass_get_ipv4(char *str, __be32 *val) return 0; } +static int rxclass_get_ipv6(char *str, __be32 *val) +{ + if (!inet_pton(AF_INET6, str, val)) + return -1; + + return 0; +} + static int rxclass_get_ether(char *str, unsigned char *val) { unsigned int buf[ETH_ALEN]; @@ -851,6 +1042,16 @@ static int rxclass_get_val(char *str, unsigned char *p, u32 *flags, *(__be32 *)&p[opt->moffset] = (__be32)mask; break; } + case OPT_IP6: { + __be32 val[4]; + err = rxclass_get_ipv6(str, val); + if (err) + return -1; + memcpy(&p[opt->offset], val, sizeof(val)); + if (opt->moffset >= 0) + memset(&p[opt->moffset], mask, sizeof(val)); + break; + } case OPT_MAC: { unsigned char val[ETH_ALEN]; err = rxclass_get_ether(str, val); @@ -950,6 +1151,17 @@ static int rxclass_get_mask(char *str, unsigned char *p, *(__be32 *)&p[opt->moffset] = ~val; break; } + case OPT_IP6: { + __be32 val[4], *field; + int i; + err = rxclass_get_ipv6(str, val); + if (err) + return -1; + field = (__be32 *)&p[opt->moffset]; + for (i = 0; i < 4; i++) + field[i] = ~val[i]; + break; + } case OPT_MAC: { unsigned char val[ETH_ALEN]; int i; @@ -996,7 +1208,19 @@ int rxclass_parse_ruleopts(struct cmd_context *ctx, else if (!strcmp(argp[0], "esp4")) flow_type = ESP_V4_FLOW; else if (!strcmp(argp[0], "ip4")) - flow_type = IP_USER_FLOW; + flow_type = IPV4_USER_FLOW; + else if (!strcmp(argp[0], "tcp6")) + flow_type = TCP_V6_FLOW; + else if (!strcmp(argp[0], "udp6")) + flow_type = UDP_V6_FLOW; + else if (!strcmp(argp[0], "sctp6")) + flow_type = SCTP_V6_FLOW; + else if (!strcmp(argp[0], "ah6")) + flow_type = AH_V6_FLOW; + else if (!strcmp(argp[0], "esp6")) + flow_type = ESP_V6_FLOW; + else if (!strcmp(argp[0], "ip6")) + flow_type = IPV6_USER_FLOW; else if (!strcmp(argp[0], "ether")) flow_type = ETHER_FLOW; else @@ -1014,10 +1238,25 @@ int rxclass_parse_ruleopts(struct cmd_context *ctx, options = rule_nfc_esp_ip4; n_opts = ARRAY_SIZE(rule_nfc_esp_ip4); break; - case IP_USER_FLOW: + case IPV4_USER_FLOW: options = rule_nfc_usr_ip4; n_opts = ARRAY_SIZE(rule_nfc_usr_ip4); break; + case TCP_V6_FLOW: + case UDP_V6_FLOW: + case SCTP_V6_FLOW: + options = rule_nfc_tcp_ip6; + n_opts = ARRAY_SIZE(rule_nfc_tcp_ip6); + break; + case AH_V6_FLOW: + case ESP_V6_FLOW: + options = rule_nfc_esp_ip6; + n_opts = ARRAY_SIZE(rule_nfc_esp_ip6); + break; + case IPV6_USER_FLOW: + options = rule_nfc_usr_ip6; + n_opts = ARRAY_SIZE(rule_nfc_usr_ip6); + break; case ETHER_FLOW: options = rule_nfc_ether; n_opts = ARRAY_SIZE(rule_nfc_ether); @@ -1081,7 +1320,7 @@ int rxclass_parse_ruleopts(struct cmd_context *ctx, } } - if (flow_type == IP_USER_FLOW) + if (flow_type == IPV4_USER_FLOW) fsp->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4; if (flags & (NTUPLE_FLAG_VLAN | NTUPLE_FLAG_UDEF | NTUPLE_FLAG_VETH)) fsp->flow_type |= FLOW_EXT;