]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
mptcp: make sure flag signal is set when add addr with port
authorJianguo Wu <wujianguo@chinatelecom.cn>
Fri, 23 Apr 2021 10:24:50 +0000 (18:24 +0800)
committerDavid Ahern <dsahern@kernel.org>
Fri, 30 Apr 2021 14:30:24 +0000 (14:30 +0000)
When add address with port, it is mean to send an ADD_ADDR to remote,
so it must have flag signal set.

Fixes: 42fbca91cd61 ("mptcp: add support for port based endpoint")
Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/ipmptcp.c

index 5f490f0026d9664ada7e376a59a3b0f70891b7b9..44af7234267b8eff41754675952e9b90215f52e0 100644 (file)
@@ -143,6 +143,9 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n,
        if (!id_set && !adding)
                missarg("ID");
 
+       if (port && !(flags & MPTCP_PM_ADDR_FLAG_SIGNAL))
+               invarg("flags must have signal when using port", "port");
+
        attr_addr = addattr_nest(n, MPTCP_BUFLEN,
                                 MPTCP_PM_ATTR_ADDR | NLA_F_NESTED);
        if (id_set)