Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd1235fc authored by Chia-chi Yeh's avatar Chia-chi Yeh Committed by Android (Google) Code Review
Browse files

Merge "VPN: do not allow zero prefix length in routing rules."

parents 57aa13eb 96c7e700
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ static int set_routes(const char *name, int index, const char *routes)
        if (strchr(address, ':')) {
            // Add an IPv6 route.
            if (inet_pton(AF_INET6, address, &rt6.rtmsg_dst) != 1 ||
                    prefix < 0 || prefix > 128) {
                    prefix < 1 || prefix > 128) {
                count = BAD_ARGUMENT;
                break;
            }
@@ -216,7 +216,7 @@ static int set_routes(const char *name, int index, const char *routes)
        } else {
            // Add an IPv4 route.
            if (inet_pton(AF_INET, address, as_in_addr(&rt4.rt_dst)) != 1 ||
                    prefix < 0 || prefix > 32) {
                    prefix < 1 || prefix > 32) {
                count = BAD_ARGUMENT;
                break;
            }