Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/net Pull up following revision(s) (requested by knaka...



details:   https://anonhg.NetBSD.org/src/rev/093df8ba101f
branches:  netbsd-7
changeset: 799714:093df8ba101f
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Nov 18 08:29:21 2015 +0000

description:
Pull up following revision(s) (requested by knakahara in ticket #1034):
        sys/net/if_gif.c: revision 1.91
        sys/net/if_gif.c: revision 1.92
fix panic after "ifconfig gifX tunnel src dst" failed for the reason of address pair duplication.
e.g.
    ====================
    # ifconfig gif0 create
    # ifconfig gif0 tunnel 192.168.0.1 192.168.0.2
    # ifconfig gif0 inet 172.16.0.1/24 172.16.0.2
    # route add 10.1.0.0/24 172.16.0.1
    # ifconfig gif1 create
    # ifconfig gif1 tunnel 192.168.0.1 192.168.0.3
    # ifconfig gif0 tunnel 192.168.0.1 192.168.0.3
    ifconfig: SIOCSLIFPHYADDR: Can't assign requested address # expected
    # ping 10.1.0.1
    (panic)
    ====================
fix CID 980463

diffstat:

 sys/net/if_gif.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (63 lines):

diff -r 2112947e3d1d -r 093df8ba101f sys/net/if_gif.c
--- a/sys/net/if_gif.c  Wed Nov 18 08:21:52 2015 +0000
+++ b/sys/net/if_gif.c  Wed Nov 18 08:29:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.c,v 1.83.2.2 2015/11/18 08:21:52 msaitoh Exp $  */
+/*     $NetBSD: if_gif.c,v 1.83.2.3 2015/11/18 08:29:21 msaitoh Exp $  */
 /*     $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $    */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.83.2.2 2015/11/18 08:21:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.83.2.3 2015/11/18 08:29:21 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -674,7 +674,8 @@
                if (sockaddr_cmp(sc2->gif_pdst, dst) == 0 &&
                    sockaddr_cmp(sc2->gif_psrc, src) == 0) {
                        error = EADDRNOTAVAIL;
-                       goto bad;
+                       /* continue to use the old configureation. */
+                       goto out;
                }
 
                /* XXX both end must be valid? (I mean, not 0.0.0.0) */
@@ -742,10 +743,8 @@
        if (odst)
                sockaddr_free(odst);
 
-       ifp->if_flags |= IFF_RUNNING;
-       splx(s);
-
-       return 0;
+       error = 0;
+       goto out;
 
 rollback:
        if (sc->gif_psrc != NULL)
@@ -754,18 +753,19 @@
                sockaddr_free(sc->gif_pdst);
        sc->gif_psrc = osrc;
        sc->gif_pdst = odst;
-bad:
+
        if (sc->gif_si) {
                softint_disestablish(sc->gif_si);
                sc->gif_si = NULL;
        }
 
+out:
        if (sc->gif_psrc && sc->gif_pdst)
                ifp->if_flags |= IFF_RUNNING;
        else
                ifp->if_flags &= ~IFF_RUNNING;
+
        splx(s);
-
        return error;
 }
 



Home | Main Index | Thread Index | Old Index