svn commit: r232640 - head/sys/net

Sergey Kandaurov pluknet at freebsd.org
Wed Mar 7 07:30:44 UTC 2012


On 7 March 2012 11:22, Andrew Thompson <thompsa at freebsd.org> wrote:
> Author: thompsa
> Date: Wed Mar  7 07:22:53 2012
> New Revision: 232640
> URL: http://svn.freebsd.org/changeset/base/232640
>
> Log:
>  Move the vlan buffer space into the union which also fixes an unused variable
>  warning with !INET & !INET6.
>
>  Spotted by:   pluknet
>
> Modified:
>  head/sys/net/if_lagg.c

Thank you.
BTW, how do you like this change?

Index: Makefile
===================================================================
--- Makefile    (revision 232637)
+++ Makefile    (working copy)
@@ -7,8 +7,10 @@
 SRCS=  if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h

 .if !defined(KERNBUILDDIR)
+.if ${MK_INET_SUPPORT} != "no"
 opt_inet.h:
        echo "#define INET 1" > ${.TARGET}
+.endif

 .if ${MK_INET6_SUPPORT} != "no"
 opt_inet6.h:


>
> Modified: head/sys/net/if_lagg.c
> ==============================================================================
> --- head/sys/net/if_lagg.c      Wed Mar  7 06:42:21 2012        (r232639)
> +++ head/sys/net/if_lagg.c      Wed Mar  7 07:22:53 2012        (r232640)
> @@ -1438,7 +1438,6 @@ lagg_hashmbuf(struct lagg_softc *sc, str
>        uint32_t p = key;
>        int off;
>        struct ether_header *eh;
> -       struct ether_vlan_header vlanbuf;
>        const struct ether_vlan_header *vlan;
>  #ifdef INET
>        const struct ip *ip;
> @@ -1456,6 +1455,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str
>  #ifdef INET6
>                struct ip6_hdr ip6;
>  #endif
> +               struct ether_vlan_header vlan;
>                uint32_t port;
>        } buf;
>
> @@ -1475,7 +1475,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str
>                p = hash32_buf(&m->m_pkthdr.ether_vtag,
>                    sizeof(m->m_pkthdr.ether_vtag), p);
>        } else if (etype == ETHERTYPE_VLAN) {
> -               vlan = lagg_gethdr(m, off,  sizeof(*vlan), &vlanbuf);
> +               vlan = lagg_gethdr(m, off,  sizeof(*vlan), &buf);
>                if (vlan == NULL)
>                        goto out;
>

-- 
wbr,
pluknet


More information about the svn-src-all mailing list