supported an ndp command suboption to disable IPv6 in the given interface
Obtained from: KAME Reviewd by: ume, gnn MFC after: 2 week
This commit is contained in:
parent
057c4aff27
commit
5b27b04579
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151474
@ -278,6 +278,12 @@ ip6_input(m)
|
|||||||
#undef M2MMAX
|
#undef M2MMAX
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* drop the packet if IPv6 operation is disabled on the IF */
|
||||||
|
if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED)) {
|
||||||
|
m_freem(m);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive);
|
in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive);
|
||||||
ip6stat.ip6s_total++;
|
ip6stat.ip6s_total++;
|
||||||
|
|
||||||
|
@ -1996,6 +1996,12 @@ nd6_output(ifp, origifp, m0, dst, rt0)
|
|||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
sendpkt:
|
sendpkt:
|
||||||
|
/* discard the packet if IPv6 operation is disabled on the interface */
|
||||||
|
if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)) {
|
||||||
|
error = ENETDOWN; /* better error? */
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef IPSEC
|
#ifdef IPSEC
|
||||||
/* clean ipsec history once it goes out of the node */
|
/* clean ipsec history once it goes out of the node */
|
||||||
ipsec_delaux(m);
|
ipsec_delaux(m);
|
||||||
|
@ -88,6 +88,10 @@ struct nd_ifinfo {
|
|||||||
|
|
||||||
#define ND6_IFF_PERFORMNUD 0x1
|
#define ND6_IFF_PERFORMNUD 0x1
|
||||||
#define ND6_IFF_ACCEPT_RTADV 0x2
|
#define ND6_IFF_ACCEPT_RTADV 0x2
|
||||||
|
#define ND6_IFF_PREFER_SOURCE 0x4 /* XXX: not related to ND. */
|
||||||
|
#define ND6_IFF_IFDISABLED 0x8 /* IPv6 operation is disabled due to
|
||||||
|
* DAD failure. (XXX: not ND-specific)
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
#define ND_IFINFO(ifp) \
|
#define ND_IFINFO(ifp) \
|
||||||
|
@ -198,6 +198,19 @@ selection, see the
|
|||||||
.Pa IMPLEMENTATION
|
.Pa IMPLEMENTATION
|
||||||
file supplied with the KAME kit.
|
file supplied with the KAME kit.
|
||||||
.It Xo
|
.It Xo
|
||||||
|
.Ic disabled
|
||||||
|
.Xc
|
||||||
|
Disable IPv6 operation on the interface.
|
||||||
|
When disabled, the interface discards any IPv6 packets
|
||||||
|
received on or being sent to the interface.
|
||||||
|
In the sending case, an error of ENETDOWN will be returned to the
|
||||||
|
application.
|
||||||
|
This flag is typically set automatically in the kernel as a result of
|
||||||
|
a certain failure of Duplicate Address Detection.
|
||||||
|
While the flag can be set or cleared by hand with the
|
||||||
|
.Nm
|
||||||
|
command, it is not generally advisable to modify this flag manually.
|
||||||
|
.It Xo
|
||||||
.Ic basereachable=(number)
|
.Ic basereachable=(number)
|
||||||
.Xc
|
.Xc
|
||||||
Specify the BaseReachbleTimer on the interface in millisecond.
|
Specify the BaseReachbleTimer on the interface in millisecond.
|
||||||
|
@ -989,6 +989,7 @@ ifinfo(ifname, argc, argv)
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
SETFLAG("disabled", ND6_IFF_IFDISABLED);
|
||||||
SETFLAG("nud", ND6_IFF_PERFORMNUD);
|
SETFLAG("nud", ND6_IFF_PERFORMNUD);
|
||||||
#ifdef ND6_IFF_ACCEPT_RTADV
|
#ifdef ND6_IFF_ACCEPT_RTADV
|
||||||
SETFLAG("accept_rtadv", ND6_IFF_ACCEPT_RTADV);
|
SETFLAG("accept_rtadv", ND6_IFF_ACCEPT_RTADV);
|
||||||
@ -1055,6 +1056,10 @@ ifinfo(ifname, argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
if (ND.flags) {
|
if (ND.flags) {
|
||||||
printf("\nFlags: ");
|
printf("\nFlags: ");
|
||||||
|
#ifdef ND6_IFF_IFDISABLED
|
||||||
|
if ((ND.flags & ND6_IFF_IFDISABLED))
|
||||||
|
printf("disabled ");
|
||||||
|
#endif
|
||||||
if ((ND.flags & ND6_IFF_PERFORMNUD))
|
if ((ND.flags & ND6_IFF_PERFORMNUD))
|
||||||
printf("nud ");
|
printf("nud ");
|
||||||
#ifdef ND6_IFF_ACCEPT_RTADV
|
#ifdef ND6_IFF_ACCEPT_RTADV
|
||||||
|
Loading…
Reference in New Issue
Block a user