Skip to content

Commit 6b02c02

Browse files
grumvalskirfuchs
authored andcommitted
MT#55283 kernel-module: clear skb->mark before forwarding to fix Cilium routing
Change-Id: Ibac5e897ed79d483ae4e8c4c3417fdd78a35f591
1 parent 10fa284 commit 6b02c02

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

kernel-module/nft_rtpengine.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4979,6 +4979,12 @@ static int send_proxy_packet4(struct sk_buff *skb, const struct re_address *src,
49794979
};
49804980

49814981
skb->protocol = htons(ETH_P_IP);
4982+
/* Clear any mark inherited from the received packet. On Cilium/GKE
4983+
* DPv2 nodes, ingress BPF stamps identity/decrypt marks on incoming
4984+
* skbs; leaving them in place can match an ip rule (e.g.
4985+
* "fwmark 0x200/0xf00 → table 2004") and send forwarded packets into
4986+
* a Cilium-internal routing table that has no default gateway. */
4987+
skb->mark = 0;
49824988

49834989
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,10,0)) || \
49844990
(defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
@@ -5066,6 +5072,9 @@ static int send_proxy_packet6(struct sk_buff *skb, const struct re_address *src,
50665072
memcpy(&ih->daddr, dst->u.ipv6, sizeof(ih->daddr));
50675073

50685074
skb->protocol = htons(ETH_P_IPV6);
5075+
/* Same reasoning as send_proxy_packet4: clear inherited Cilium ingress
5076+
* marks to avoid misrouting via Cilium-internal tables. */
5077+
skb->mark = 0;
50695078

50705079
memset(&fl6, 0, sizeof(fl6));
50715080
memcpy(&fl6.saddr, src->u.ipv6, sizeof(fl6.saddr));

0 commit comments

Comments
 (0)