On 1/17/19 3:52 PM, Jakub Kicinski wrote:
> +     rtm = nlmsg_data(nlh);
> +     if ((rtm->rtm_src_len && rtm->rtm_src_len != 32) ||
> +         (rtm->rtm_dst_len && rtm->rtm_dst_len != 32) ||
> +         rtm->rtm_tos || rtm->rtm_table || rtm->rtm_protocol ||
> +         rtm->rtm_scope || rtm->rtm_type || rtm->rtm_flags) {
> +             NL_SET_ERR_MSG(extack, "ipv4: MR invalid values in header for 
> route get request");

The MR at the beginning makes that read awkwardly. Perhaps:

ipv4: Invalid values in header for multicast route get request


> +             return -EINVAL;
> +     }
> +
> +     err = nlmsg_parse_strict(nlh, sizeof(*rtm), tb, RTA_MAX,
> +                              rtm_ipv4_policy, extack);
> +     if (err)
> +             return err;
> +
> +     if ((tb[RTA_SRC] && !rtm->rtm_src_len) ||
> +         (tb[RTA_DST] && !rtm->rtm_dst_len)) {
> +             NL_SET_ERR_MSG(extack, "ipv4: MR rtm_src_len and rtm_dst_len 
> must be 32 for IPv4");

and here. Also ipv4 is listed twice.

> +             return -EINVAL;
> +     }
> +
> +     for (i = 0; i <= RTA_MAX; i++) {
> +             if (!tb[i])
> +                     continue;
> +
> +             switch (i) {
> +             case RTA_SRC:
> +             case RTA_DST:
> +             case RTA_TABLE:
> +                     break;
> +             default:
> +                     NL_SET_ERR_MSG(extack, "ipv4: MR unsupported attribute 
> in route get request");

and here

Reply via email to