Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Setting of source and destination IP is not done by



details:   https://anonhg.NetBSD.org/src/rev/179591c6ef44
branches:  trunk
changeset: 471493:179591c6ef44
user:      hwr <hwr%NetBSD.org@localhost>
date:      Fri Apr 02 20:39:23 1999 +0000

description:
Setting of source and destination IP is not done by
passing SIOCSIFADDR/SIOIFDSTADDR, but by passing the addresses in
the appropriate structs.
One of the mysteries of ifconfig IMHO...

Should fix kern/6899.

diffstat:

 sys/netinet/ip_ipip.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r ee5725ac31d4 -r 179591c6ef44 sys/netinet/ip_ipip.c
--- a/sys/netinet/ip_ipip.c     Fri Apr 02 20:13:40 1999 +0000
+++ b/sys/netinet/ip_ipip.c     Fri Apr 02 20:39:23 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_ipip.c,v 1.3 1999/02/02 07:20:13 thorpej Exp $      */
+/*     $NetBSD: ip_ipip.c,v 1.4 1999/04/02 20:39:23 hwr Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -287,6 +287,7 @@
 {
        struct ipip_softc *sc = ifp->if_softc;
        struct ifaddr *ifa = (struct ifaddr *)data;
+       struct in_ifaddr *ia = (struct in_ifaddr *)data;
        struct ifreq *ifr = (struct ifreq *)data;
        int s, error = 0;
 
@@ -300,10 +301,8 @@
                        break;
                }
 
-               if (cmd == SIOCSIFADDR)
                        sc->sc_src = (satosin(ifa->ifa_addr))->sin_addr;
-               else
-                       sc->sc_dst = (satosin(ifa->ifa_dstaddr))->sin_addr;
+                       sc->sc_dst = ia->ia_dstaddr.sin_addr;
 
                if (!in_nullhost(sc->sc_src) && !in_nullhost(sc->sc_dst)) {
                        ipip_compute_route(sc);



Home | Main Index | Thread Index | Old Index