lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 21 Feb 2018 10:04:00 -0700
From:   David Ahern <dsahern@...il.com>
To:     Donald Sharp <sharpd@...ulusnetworks.com>, netdev@...r.kernel.org,
        dsahern@...il.com
Subject: Re: [PATCH iproute2-next 1/4] ip: Use the `struct fib_rule_hdr` for
 rules

On 2/20/18 6:53 PM, Donald Sharp wrote:
> @@ -159,7 +159,13 @@ static bool filter_nlmsg(struct nlmsghdr *n, struct rtattr **tb, int host_len)
>  			return false;
>  	}
>  
> -	table = rtm_get_table(r, tb);
> +
> +	/* struct fib_rule_hdr and struct rtmsg
> +	 * were intentionally the same.  Since
> +	 * the table is the rtm_table, just call
> +	 * it.
> +	 */
> +	table = rtm_get_table((struct rtmsg *)frh, tb);
>  	if (filter.tb > 0 && filter.tb ^ table)
>  		return false;
>  
...

> @@ -273,7 +279,12 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
>  		fprintf(fp, "uidrange %u-%u ", r->start, r->end);
>  	}
>  
> -	table = rtm_get_table(r, tb);
> +	/* struct fib_rule_hdr and struct rtmsg
> +	 * were intentionally the same.  Since
> +	 * the table is the rtm_table, just call
> +	 * it.
> +	 */
> +	table = rtm_get_table((struct rtmsg *)frh, tb);
>  	if (table) {
>  		fprintf(fp, "lookup %s ",
>  			rtnl_rttable_n2a(table, b1, sizeof(b1)));

I would rather have a second get_table function than use the typecast;
frh_get_table() that mirrors rtm_get_table.

Thanks for taking the time to fix the ancillary header struct.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ