Fix a bug whereby the physical endpoints of a gre(4) tunnel would not
be printed, if the module were loaded into a kernel which had INET6 enabled. The gre(4) driver does not use INET6, nor is it specified for IPv6. The tunnel_status() function in ifconfig(8) is somewhat overzealous and assumes that all tunnel interfaces speak KAME ifioctls. This fix follows the path of least resistance, by teaching gre(4) about the two KAME ifioctls concerned. PR: bin/56341
This commit is contained in:
parent
1bf8720450
commit
f16770ae7e
@ -1,13 +1,16 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet
|
||||
.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6
|
||||
|
||||
KMOD= if_gre
|
||||
SRCS= if_gre.c ip_gre.c opt_inet.h opt_atalk.h
|
||||
SRCS= if_gre.c ip_gre.c opt_inet.h opt_inet6.h opt_atalk.h
|
||||
|
||||
opt_inet.h:
|
||||
echo "#define INET 1" > ${.TARGET}
|
||||
|
||||
opt_inet6.h:
|
||||
echo "#define INET6 1" > ${.TARGET}
|
||||
|
||||
opt_atalk.h:
|
||||
echo "#define NETATALK 1" > ${.TARGET}
|
||||
|
||||
|
@ -48,6 +48,7 @@
|
||||
|
||||
#include "opt_atalk.h"
|
||||
#include "opt_inet.h"
|
||||
#include "opt_inet6.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -585,6 +586,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
memcpy(&lifr->dstaddr, &si, sizeof(si));
|
||||
break;
|
||||
case SIOCGIFPSRCADDR:
|
||||
#ifdef INET6
|
||||
case SIOCGIFPSRCADDR_IN6:
|
||||
#endif
|
||||
if (sc->g_src.s_addr == INADDR_ANY) {
|
||||
error = EADDRNOTAVAIL;
|
||||
break;
|
||||
@ -596,6 +600,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
bcopy(&si, &ifr->ifr_addr, sizeof(ifr->ifr_addr));
|
||||
break;
|
||||
case SIOCGIFPDSTADDR:
|
||||
#ifdef INET6
|
||||
case SIOCGIFPDSTADDR_IN6:
|
||||
#endif
|
||||
if (sc->g_dst.s_addr == INADDR_ANY) {
|
||||
error = EADDRNOTAVAIL;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user