On Sat, Sep 12, 2015 at 02:45:24PM +0000, Florian Obser wrote:
> @@ -117,44 +117,12 @@ pflow_clone_create(struct if_clone *ifc, int unit)
...
>       MGET(pflowif->send_nam, M_WAIT, MT_SONAME);
> -     sin = mtod(pflowif->send_nam, struct sockaddr_in *);
> -     memset(sin, 0 , sizeof(*sin));
> -     sin->sin_len = pflowif->send_nam->m_len = sizeof (struct sockaddr_in);
> -     sin->sin_family = AF_INET;

I think you should keep these 4 initialsation lines.  Then the
padding is always zero and those fields never change.

> @@ -379,7 +345,11 @@ pflowioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
>               if (pflowr.addrmask & PFLOW_MASK_DSTIP) {
>                       sc->sc_receiver_ip.s_addr = pflowr.receiver_ip.s_addr;
>                       sin = mtod(sc->send_nam, struct sockaddr_in *);
> +                     sin->sin_len = sc->send_nam->m_len =
> +                         sizeof (struct sockaddr_in);
> +                     sin->sin_family = AF_INET;

Here the memset is missing.  But better do that all in
pflow_clone_create().

The rest of the diff is fine.

bluhm

Reply via email to