diff options
author | Luiz Souza <luiz@netgate.com> | 2017-08-11 12:57:06 -0500 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2017-08-11 13:00:50 -0500 |
commit | 5a3791a403b1ebc67490b1f46dedc5767ffc8a2c (patch) | |
tree | 0c7299ff95fa3418ccb69ff1a76652ad2207fb0b /sys/net/if_stf.c | |
parent | 03d5f437139b1157dbe036e166606abf61cfc06f (diff) | |
download | FreeBSD-src-5a3791a403b1ebc67490b1f46dedc5767ffc8a2c.zip FreeBSD-src-5a3791a403b1ebc67490b1f46dedc5767ffc8a2c.tar.gz |
Fix the import of 6rd to accept inet6 addresses other than 2002::.
(cherry picked from commit c7cb7c5dd18db88217dd3fc69cbd48beceac7ae3)
Diffstat (limited to 'sys/net/if_stf.c')
-rw-r--r-- | sys/net/if_stf.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index c0b27b7..55d3940 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -1033,10 +1033,9 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ifaddr *ifa; struct ifdrv *ifd; struct ifreq *ifr; - struct sockaddr_in6 *sin6; + struct sockaddr_in sin4; struct stf_softc *sc, *sc_cur; struct stfv4args args; - struct in_addr addr; struct in6_addr addr6, mask6; int error, mtu; @@ -1124,13 +1123,9 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = EAFNOSUPPORT; break; } - sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; - if (!IN6_IS_ADDR_6TO4(&sin6->sin6_addr)) { - error = EINVAL; - break; - } - bcopy(GET_V4(&sin6->sin6_addr), &addr, sizeof(addr)); - if (isrfc1918addr(&addr)) { + if (stf_getin4addr(sc_cur, &sin4, + satosin6(ifa->ifa_addr)->sin6_addr, + satosin6(ifa->ifa_netmask)->sin6_addr) == NULL) { error = EINVAL; break; } |