Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1699365

Re: [PATCH 1/1] netfilter: constify nf_conntrack_l3/4proto parameters

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] netfilter: constify nf_conntrack_l3/4proto parameters
Date 2017-07-29 22:20 +0200
Message-ID <u8Gno-7k6-11@gated-at.bofh.it> (permalink)
References <u8FUl-6S9-5@gated-at.bofh.it> <u8FUl-6S9-15@gated-at.bofh.it> <u8GdH-7fT-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On Sat, 29 Jul 2017, Florian Westphal wrote:

> Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> > When a nf_conntrack_l3/4proto parameter is not on the left hand side
> > of an assignment, its address is not taken, and it is not passed to a
> > function that may modify its fields, then it can be declared as const.
> >
> > This change is useful from a documentation point of view, and can
> > possibly facilitate making some nf_conntrack_l3/4proto structures const
> > subsequently.
> >
> > Done with the help of Coccinelle.
> >
> > Some spacing adjusted to fit within 80 characters.
>
> Acked-by: Florian Westphal <fw@strlen.de>
>
> Thanks Julia.
>
> I think we can indeed constify these completely after making
> 'nla_size' set at compile time.
>
> I'll send a simple attempt to make it so for l3proto soon.

There is another issue with respect to nf_ct_l3proto_unregister.  This
calls nf_ct_iterate_destroy with l3proto as the second argument.  This
function has signature:

void
nf_ct_iterate_destroy(int (*iter)(struct nf_conn *i, void *data), void *data)

The void * is not const.  Maybe it could be.

julia

> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/1] constify nf_conntrack_l3/4proto parameters Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-29 21:50 +0200
  [PATCH 1/1] netfilter: constify nf_conntrack_l3/4proto parameters Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-29 21:50 +0200
    Re: [PATCH 1/1] netfilter: constify nf_conntrack_l3/4proto parameters Florian Westphal <fw@strlen.de> - 2017-07-29 22:10 +0200
      Re: [PATCH 1/1] netfilter: constify nf_conntrack_l3/4proto  parameters Julia Lawall <julia.lawall@lip6.fr> - 2017-07-29 22:20 +0200
        Re: [PATCH 1/1] netfilter: constify nf_conntrack_l3/4proto parameters Florian Westphal <fw@strlen.de> - 2017-07-29 23:30 +0200

csiph-web