Skip to content

UDP close removes only one firewall rule #112

Description

@nding0405
  1. Problem
    A UDP socket can have many firewall rules. On close, the code calls:
firewall_remove_udpipv4_local_endpoint(localPort);

[Close path](

else
{
firewall_remove_udpipv4_local_endpoint(localPort);
}
)

However, the remove loop stops after the first match:

table.remove(&tuple);
break;

[Remove loop](

for (auto &tuple : table)
{
if (tuple.localPort == localPort)
{
table.remove(&tuple);
break;
}
)

  1. Why is it bad
    One UDP socket may allow many remote hosts. These rules all have the same local port. Closing the socket removes only one hole. The other holes stay in the firewall.

  2. Suggested fix
    Remove every UDP rule with the matching local port. Do this for both IPv4 and IPv6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions