]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
After r274246 make the tree compile again.
authorbz <bz@FreeBSD.org>
Sat, 8 Nov 2014 14:41:32 +0000 (14:41 +0000)
committerbz <bz@FreeBSD.org>
Sat, 8 Nov 2014 14:41:32 +0000 (14:41 +0000)
gcc requires variables to be initialised in two places.  One of them
is correctly  used only under the same conditional though.

For module builds properly check if the kernel supports INET or INET6,
as otherwise various mips kernels without IPv6 support would fail to build.

sys/modules/if_gre/Makefile
sys/net/if_gre.c

index db8f9f197a89901263d86deb925899dd1a60edda..54ef274419a11a0554c74f7ecad6dcba59f74f53 100644 (file)
@@ -6,10 +6,24 @@
 KMOD=  if_gre
 SRCS=  if_gre.c opt_inet.h opt_inet6.h
 
+.if defined(KERNBUILDDIR)
+OPT_INET!= cat ${KERNBUILDDIR}/opt_inet.h; echo
+.if empty(OPT_INET)
+MK_INET_SUPPORT=no
+.endif
+.endif
+
 .if ${MK_INET_SUPPORT} != "no"
 SRCS+= ip_gre.c
 .endif
 
+.if defined(KERNBUILDDIR)
+OPT_INET6!= cat ${KERNBUILDDIR}/opt_inet6.h; echo
+.if empty(OPT_INET6)
+MK_INET6_SUPPORT=no
+.endif
+.endif
+
 .if ${MK_INET6_SUPPORT} != "no"
 SRCS+= ip6_gre.c
 .endif
index 495334848105e03c3c727e69d475b89b2f95cac5..4d00ca2911a58f88f19a31ed59ecc8f2b11541ae 100644 (file)
@@ -632,6 +632,7 @@ gre_set_tunnel(struct ifnet *ifp, struct sockaddr *src,
        gre_updatehdr(sc);
        GRE_WUNLOCK(sc);
 
+       error = 0;
        switch (src->sa_family) {
 #ifdef INET
        case AF_INET:
@@ -865,6 +866,8 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m)
        want_seq = (sc->gre_options & GRE_ENABLE_SEQ) != 0;
        if (want_seq)
                oseq = sc->gre_oseq++; /* XXX */
+       else
+               oseq = 0;               /* Make compiler happy. */
        want_csum = (sc->gre_options & GRE_ENABLE_CSUM) != 0;
        M_SETFIB(m, sc->gre_fibnum);
        M_PREPEND(m, hlen, M_NOWAIT);