hnat: fix nat66 issue

ref: 317dbfad66
This commit is contained in:
hanwckf 2023-06-27 22:59:23 +08:00
parent fe05ec6020
commit b9d3e4343a

View File

@ -1184,12 +1184,16 @@ static unsigned int skb_to_hnat_info(struct sk_buff *skb,
struct ipv6hdr *ip6h;
struct tcpudphdr _ports;
const struct tcpudphdr *pptr;
struct nf_conn *ct;
enum ip_conntrack_info ctinfo;
u32 gmac = NR_DISCARD;
int udp = 0;
u32 qid = 0;
u32 port_id = 0;
int mape = 0;
ct = nf_ct_get(skb, &ctinfo);
if (ipv6_hdr(skb)->nexthdr == NEXTHDR_IPIP)
/* point to ethernet header for DS-Lite and MapE */
eth = (struct ethhdr *)(skb->data - ETH_HLEN);
@ -1386,6 +1390,11 @@ static unsigned int skb_to_hnat_info(struct sk_buff *skb,
entry.ipv6_5t_route.dport =
foe->ipv6_5t_route.dport;
}
if (ct && (ct->status & IPS_SRC_NAT)) {
return -1;
}
entry.ipv6_5t_route.iblk2.dscp =
(ip6h->priority << 4 |
(ip6h->flow_lbl[0] >> 4));