netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Donald Sharp <sharpd@cumulusnetworks.com>, netdev@vger.kernel.org
Subject: Re: [PATCH v2 iproute2-next 1/3] ip: Use the `struct fib_rule_hdr` for rules
Date: Thu, 22 Feb 2018 10:23:00 -0700	[thread overview]
Message-ID: <3edc6401-cb6a-82a1-3b7b-7aa41b67d227@gmail.com> (raw)
In-Reply-To: <20180222021218.12948-2-sharpd@cumulusnetworks.com>

On 2/21/18 7:12 PM, Donald Sharp wrote:
> @@ -577,21 +585,20 @@ static int iprule_modify(int cmd, int argc, char **argv)
>  	__u32 tid = 0;
>  	struct {
>  		struct nlmsghdr	n;
> -		struct rtmsg		r;
> +		struct fib_rule_hdr	frh;
>  		char			buf[1024];
>  	} req = {
>  		.n.nlmsg_type = cmd,
> -		.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)),
> +		.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct fib_rule_hdr)),
>  		.n.nlmsg_flags = NLM_F_REQUEST,
> -		.r.rtm_family = preferred_family,
> -		.r.rtm_protocol = RTPROT_BOOT,
> -		.r.rtm_scope = RT_SCOPE_UNIVERSE,
> -		.r.rtm_type = RTN_UNSPEC,
> +		.frh.family = preferred_family,
> +		.frh.proto = RTPROT_BOOT,
> +		.frh.action = RTN_UNSPEC,
>  	};
>  
>  	if (cmd == RTM_NEWRULE) {
>  		req.n.nlmsg_flags |= NLM_F_CREATE|NLM_F_EXCL;
> -		req.r.rtm_type = RTN_UNICAST;
> +		req.frh.action = RTN_UNICAST;
>  	}

The action should be FR_ACT_TO_TBL; RTN_UNICAST == 1 == FR_ACT_TO_TBL;
the latter is the proper enum for fib rules.

  reply	other threads:[~2018-02-22 17:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21  1:53 [PATCH iproute2-next 0/4] Allow 'ip rule' command to use protocol Donald Sharp
2018-02-22  2:12 ` [PATCH v2 iproute2-next 0/3] " Donald Sharp
2018-02-22  2:12 ` [PATCH v2 iproute2-next 1/3] ip: Use the `struct fib_rule_hdr` for rules Donald Sharp
2018-02-22 17:23   ` David Ahern [this message]
2018-02-22  2:12 ` [PATCH v2 iproute2-next 2/3] ip: Display ip rule protocol used Donald Sharp
2018-02-22 21:28   ` David Ahern
2018-02-22  2:12 ` [PATCH v2 iproute2-next 3/3] ip: Allow rules to accept a specified protocol Donald Sharp
2018-02-23 19:32 ` [PATCH v3 iproute2-next 0/3] Allow 'ip rule' command to use protocol Donald Sharp
2018-02-23 19:32 ` [PATCH v3 iproute2-next 1/3] ip: Use the `struct fib_rule_hdr` for rules Donald Sharp
2018-02-23 19:32 ` [PATCH v3 iproute2-next 2/3] ip: Display ip rule protocol used Donald Sharp
2018-02-26 21:35   ` David Ahern
2018-02-23 19:32 ` [PATCH v3 iproute2-next 3/3] ip: Allow rules to accept a specified protocol Donald Sharp
2018-02-28 23:43 ` [PATCH v4 iproute2-next 0/3] Allow 'ip rule' command to use protocol Donald Sharp
2018-03-01  3:46   ` David Ahern
2018-02-28 23:43 ` [PATCH v4 iproute2-next 1/3] ip: Use the `struct fib_rule_hdr` for rules Donald Sharp
2018-02-28 23:43 ` [PATCH v4 iproute2-next 2/3] ip: Display ip rule protocol used Donald Sharp
2018-02-28 23:44 ` [PATCH v4 iproute2-next 3/3] ip: Allow rules to accept a specified protocol Donald Sharp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3edc6401-cb6a-82a1-3b7b-7aa41b67d227@gmail.com \
    --to=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sharpd@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).