summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gre.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2003-11-14 20:58:00 +0000
committerbms <bms@FreeBSD.org>2003-11-14 20:58:00 +0000
commit134bbb89c8f75adda55150ff226f7cbb0a293090 (patch)
treee3d3ff56cbe6c2f51a779e753ade008e3e2c2465 /sys/net/if_gre.c
parent5b076fe9da6e7bfd69aca6e09e64d75d72477b92 (diff)
downloadFreeBSD-src-134bbb89c8f75adda55150ff226f7cbb0a293090.zip
FreeBSD-src-134bbb89c8f75adda55150ff226f7cbb0a293090.tar.gz
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
Diffstat (limited to 'sys/net/if_gre.c')
-rw-r--r--sys/net/if_gre.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 3541410..4c5f8d46 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -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;
OpenPOWER on IntegriCloud