• Jason Wang's avatar
    tuntap: limit the number of flow caches · b8732fb7
    Jason Wang authored
    We create new flow caches when a new flow is identified by tuntap, This may lead
    some issues:
    
    - userspace may produce a huge amount of short live flows to exhaust host memory
    - the unlimited number of flow caches may produce a long list which increase the
      time in the linear searching
    
    Solve this by introducing a limit of total number of flow caches.
    
    Cc: Stephen Hemminger <stephen@networkplumber.org>
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b8732fb7
tun.c 53.5 KB