shortcut-fe: don't accelerate locally generated packets
Change-Id: I8d9a6789ccf1a96d6ae48324a6c37f16b5ea2275
Signed-off-by: Xiaoping Fan <xfan@codeaurora.org>
diff --git a/shortcut-fe/sfe_cm.c b/shortcut-fe/sfe_cm.c
index b014652..1ca09a1 100644
--- a/shortcut-fe/sfe_cm.c
+++ b/shortcut-fe/sfe_cm.c
@@ -45,6 +45,7 @@
SFE_CM_EXCEPTION_NO_DEST_DEV,
SFE_CM_EXCEPTION_NO_DEST_XLATE_DEV,
SFE_CM_EXCEPTION_NO_BRIDGE,
+ SFE_CM_EXCEPTION_LOCAL_OUT,
SFE_CM_EXCEPTION_MAX
} sfe_cm_exception_t;
@@ -65,7 +66,8 @@
"NO_SRC_XLATE_DEV",
"NO_DEST_DEV",
"NO_DEST_XLATE_DEV",
- "NO_BRIDGE"
+ "NO_BRIDGE",
+ "LOCAL_OUT"
};
/*
@@ -320,6 +322,15 @@
#endif
/*
+ * Don't process locally generated packets.
+ */
+ if (skb->sk) {
+ sfe_cm_incr_exceptions(SFE_CM_EXCEPTION_LOCAL_OUT);
+ DEBUG_TRACE("skip local out packet\n");
+ return NF_ACCEPT;
+ }
+
+ /*
* Don't process packets that are not being forwarded.
*/
in = dev_get_by_index(&init_net, skb->skb_iif);