From: Jianguo Wu Date: Fri, 23 Apr 2021 10:24:50 +0000 (+0800) Subject: mptcp: make sure flag signal is set when add addr with port X-Git-Tag: v5.14.0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f1d58d1a1c59d2cc3fdae04e8f03d411fe22905;p=thirdparty%2Fiproute2.git mptcp: make sure flag signal is set when add addr with port 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 Acked-by: Matthieu Baerts Signed-off-by: David Ahern --- diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c index 5f490f002..44af72342 100644 --- a/ip/ipmptcp.c +++ b/ip/ipmptcp.c @@ -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)