]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/ipv4/ip_fragment.c
inet: limit length of fragment queue hash table bucket lists
[karo-tx-linux.git] / net / ipv4 / ip_fragment.c
index eb9d63a570cd1ce595076096d9b2aea3723a4c38..a8fc332d07f7e33255728ef7d112d1b3610d164c 100644 (file)
@@ -299,14 +299,11 @@ static inline struct ipq *ip_find(struct net *net, struct iphdr *iph, u32 user)
        hash = ipqhashfn(iph->id, iph->saddr, iph->daddr, iph->protocol);
 
        q = inet_frag_find(&net->ipv4.frags, &ip4_frags, &arg, hash);
-       if (q == NULL)
-               goto out_nomem;
-
+       if (IS_ERR_OR_NULL(q)) {
+               inet_frag_maybe_warn_overflow(q, pr_fmt());
+               return NULL;
+       }
        return container_of(q, struct ipq, q);
-
-out_nomem:
-       LIMIT_NETDEBUG(KERN_ERR pr_fmt("ip_frag_create: no memory left !\n"));
-       return NULL;
 }
 
 /* Is the fragment too far ahead to be part of ipq? */