History

netfilter: flowtable: fix missing FLOWI_FLAG_ANYSRC flag

The nf_flow_table gets route through ip_route_output_key. If the saddr is not local one, then FLOWI_FLAG_ANYSRC flag should be set. Without this flag, the route lookup for other_dst will fail.

wenxu committed 4 years ago

Commit f1896d41 parent f9a43001 file · +2 −0Browse files

Unified · Split

net/netfilter/nft_flow_offload.c+2−0
@@ -237,6 +237,7 @@ static int nft_flow_route(const struct nft_pktinfo *pkt, · 236 unmodified lines
237 fl.u.ip4.flowi4_iif = this_dst->dev->ifindex;237 fl.u.ip4.flowi4_iif = this_dst->dev->ifindex;
238 fl.u.ip4.flowi4_tos = RT_TOS(ip_hdr(pkt->skb)->tos);238 fl.u.ip4.flowi4_tos = RT_TOS(ip_hdr(pkt->skb)->tos);
239 fl.u.ip4.flowi4_mark = pkt->skb->mark;239 fl.u.ip4.flowi4_mark = pkt->skb->mark;
240 fl.u.ip4.flowi4_flags = FLOWI_FLAG_ANYSRC;
240 break;241 break;
241 case NFPROTO_IPV6:242 case NFPROTO_IPV6:
242 fl.u.ip6.daddr = ct->tuplehash[dir].tuple.src.u3.in6;243 fl.u.ip6.daddr = ct->tuplehash[dir].tuple.src.u3.in6;
@@ -245,6 +246,7 @@ static int nft_flow_route(const struct nft_pktinfo *pkt, · 2 unmodified lines
245 fl.u.ip6.flowi6_iif = this_dst->dev->ifindex;246 fl.u.ip6.flowi6_iif = this_dst->dev->ifindex;
246 fl.u.ip6.flowlabel = ip6_flowinfo(ipv6_hdr(pkt->skb));247 fl.u.ip6.flowlabel = ip6_flowinfo(ipv6_hdr(pkt->skb));
247 fl.u.ip6.flowi6_mark = pkt->skb->mark;248 fl.u.ip6.flowi6_mark = pkt->skb->mark;
249 fl.u.ip6.flowi6_flags = FLOWI_FLAG_ANYSRC;
248 break;250 break;
249 }251 }
250 252

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t