Re: [PATCH V1 net-next] net: only check perm protocol when register proto

From: David Miller
Date: Thu Sep 17 2015 - 19:20:46 EST


From: martinbj2008@xxxxxxxxx
Date: Tue, 15 Sep 2015 08:14:05 +0800

> @@ -1043,22 +1043,16 @@ void inet_register_protosw(struct inet_protosw *p)
> goto out_illegal;
>
> /* If we are trying to override a permanent protocol, bail. */
> - answer = NULL;
> last_perm = &inetsw[p->type];
> list_for_each(lh, &inetsw[p->type]) {
> answer = list_entry(lh, struct inet_protosw, list);
> -
> /* Check only the non-wild match. */
> - if (INET_PROTOSW_PERMANENT & answer->flags) {
> - if (protocol == answer->protocol)
> + if ((INET_PROTOSW_PERMANENT & answer->flags) == 0)
> break;
> - last_perm = lh;

Well, if you're going to do this, you need to fix up the indentation
of that "break;" statement.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/