|
@@ -14,6 +14,30 @@
|
|
|
|
|
|
static unsigned int nf_ct_generic_timeout __read_mostly = 600*HZ;
|
|
static unsigned int nf_ct_generic_timeout __read_mostly = 600*HZ;
|
|
|
|
|
|
|
|
+static bool nf_generic_should_process(u8 proto)
|
|
|
|
+{
|
|
|
|
+ switch (proto) {
|
|
|
|
+#ifdef CONFIG_NF_CT_PROTO_SCTP_MODULE
|
|
|
|
+ case IPPROTO_SCTP:
|
|
|
|
+ return false;
|
|
|
|
+#endif
|
|
|
|
+#ifdef CONFIG_NF_CT_PROTO_DCCP_MODULE
|
|
|
|
+ case IPPROTO_DCCP:
|
|
|
|
+ return false;
|
|
|
|
+#endif
|
|
|
|
+#ifdef CONFIG_NF_CT_PROTO_GRE_MODULE
|
|
|
|
+ case IPPROTO_GRE:
|
|
|
|
+ return false;
|
|
|
|
+#endif
|
|
|
|
+#ifdef CONFIG_NF_CT_PROTO_UDPLITE_MODULE
|
|
|
|
+ case IPPROTO_UDPLITE:
|
|
|
|
+ return false;
|
|
|
|
+#endif
|
|
|
|
+ default:
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
static inline struct nf_generic_net *generic_pernet(struct net *net)
|
|
static inline struct nf_generic_net *generic_pernet(struct net *net)
|
|
{
|
|
{
|
|
return &net->ct.nf_ct_proto.generic;
|
|
return &net->ct.nf_ct_proto.generic;
|
|
@@ -67,7 +91,7 @@ static int generic_packet(struct nf_conn *ct,
|
|
static bool generic_new(struct nf_conn *ct, const struct sk_buff *skb,
|
|
static bool generic_new(struct nf_conn *ct, const struct sk_buff *skb,
|
|
unsigned int dataoff, unsigned int *timeouts)
|
|
unsigned int dataoff, unsigned int *timeouts)
|
|
{
|
|
{
|
|
- return true;
|
|
|
|
|
|
+ return nf_generic_should_process(nf_ct_protonum(ct));
|
|
}
|
|
}
|
|
|
|
|
|
#if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT)
|
|
#if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT)
|