diff mbox

[net,v2,2/2] mpls: fix mpls route deletes to not check for route scope

Message ID 1432751825-40804-3-git-send-email-roopa@cumulusnetworks.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Roopa Prabhu May 27, 2015, 6:37 p.m. UTC
From: Roopa Prabhu <roopa@cumulusnetworks.com>

Ignore scope for route del messages

Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
 net/mpls/af_mpls.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Robert Shearman May 27, 2015, 7:46 p.m. UTC | #1
On 27/05/15 19:37, Roopa Prabhu wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> Ignore scope for route del messages
>
> Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Reviewed-by: Robert Shearman <rshearma@brocade.com>

> ---
>   net/mpls/af_mpls.c |    6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
> index 7b3f732..f4eb0dd 100644
> --- a/net/mpls/af_mpls.c
> +++ b/net/mpls/af_mpls.c
> @@ -693,8 +693,10 @@ static int rtm_to_route_config(struct sk_buff *skb,  struct nlmsghdr *nlh,
>   	 * (or source specific address in the case of multicast)
>   	 * all addresses have universal scope.
>   	 */
> -	if (rtm->rtm_scope != RT_SCOPE_UNIVERSE)
> -		goto errout;
> +	if (nlh->nlmsg_type != RTM_DELROUTE &&
> +		rtm->rtm_scope != RT_SCOPE_UNIVERSE)
> +			goto errout;
> +
>   	if (rtm->rtm_type != RTN_UNICAST)
>   		goto errout;
>   	if (rtm->rtm_flags != 0)
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller June 1, 2015, 10:58 p.m. UTC | #2
From: Roopa Prabhu <roopa@cumulusnetworks.com>
Date: Wed, 27 May 2015 11:37:05 -0700

> -	if (rtm->rtm_scope != RT_SCOPE_UNIVERSE)
> -		goto errout;
> +	if (nlh->nlmsg_type != RTM_DELROUTE &&
> +		rtm->rtm_scope != RT_SCOPE_UNIVERSE)
> +			goto errout;
> +

This is not indented correctly.

When a conditional spans multiple lines, two things must happen:

1) Each line must end with an operator rather than begin with one.

2) Each line starting with the second must start exactly at the
   first column after the openning parenthesis of the conditional.
   You must use the appropriate number of TAB then SPACE characters
   necessary to achieve this.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Roopa Prabhu June 2, 2015, 3:35 p.m. UTC | #3
On 6/1/15, 3:58 PM, David Miller wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
> Date: Wed, 27 May 2015 11:37:05 -0700
>
>> -	if (rtm->rtm_scope != RT_SCOPE_UNIVERSE)
>> -		goto errout;
>> +	if (nlh->nlmsg_type != RTM_DELROUTE &&
>> +		rtm->rtm_scope != RT_SCOPE_UNIVERSE)
>> +			goto errout;
>> +
> This is not indented correctly.
>
> When a conditional spans multiple lines, two things must happen:
>
> 1) Each line must end with an operator rather than begin with one.
>
> 2) Each line starting with the second must start exactly at the
>     first column after the openning parenthesis of the conditional.
>     You must use the appropriate number of TAB then SPACE characters
>     necessary to achieve this.
>
sorry, missed this. I have resubmitted the series. thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 7b3f732..f4eb0dd 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -693,8 +693,10 @@  static int rtm_to_route_config(struct sk_buff *skb,  struct nlmsghdr *nlh,
 	 * (or source specific address in the case of multicast)
 	 * all addresses have universal scope.
 	 */
-	if (rtm->rtm_scope != RT_SCOPE_UNIVERSE)
-		goto errout;
+	if (nlh->nlmsg_type != RTM_DELROUTE &&
+		rtm->rtm_scope != RT_SCOPE_UNIVERSE)
+			goto errout;
+
 	if (rtm->rtm_type != RTN_UNICAST)
 		goto errout;
 	if (rtm->rtm_flags != 0)