summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_input.c
diff options
context:
space:
mode:
authorjinmei <jinmei@FreeBSD.org>2007-05-14 17:56:13 +0000
committerjinmei <jinmei@FreeBSD.org>2007-05-14 17:56:13 +0000
commit3b02a8ea6ac8f31836a4c8a2dae1e53e6b54c5ba (patch)
tree0915a71d22f44eb255274d90ce3e3312c2feede4 /sys/netinet6/ip6_input.c
parent7ce35c288a65156c2b2390597db60ba80aafea85 (diff)
downloadFreeBSD-src-3b02a8ea6ac8f31836a4c8a2dae1e53e6b54c5ba.zip
FreeBSD-src-3b02a8ea6ac8f31836a4c8a2dae1e53e6b54c5ba.tar.gz
handle IPv6 router alert option contained in an incoming packet per
option value so that unrecognized options are ignored as specified in RFC2711. (packets containing an MLD router alert option are passed to the upper layer as before). Approved by: gnn (mentor), ume (mentor)
Diffstat (limited to 'sys/netinet6/ip6_input.c')
-rw-r--r--sys/netinet6/ip6_input.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 099bdc7..aa604bd 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -657,11 +657,25 @@ passin:
nxt = hbh->ip6h_nxt;
/*
- * accept the packet if a router alert option is included
- * and we act as an IPv6 router.
+ * If we are acting as a router and the packet contains a
+ * router alert option, see if we know the option value.
+ * Currently, we only support the option value for MLD, in which
+ * case we should pass the packet to the multicast routing
+ * daemon.
*/
- if (rtalert != ~0 && ip6_forwarding)
- ours = 1;
+ if (rtalert != ~0 && ip6_forwarding) {
+ switch (rtalert) {
+ case IP6OPT_RTALERT_MLD:
+ ours = 1;
+ break;
+ default:
+ /*
+ * RFC2711 requires unrecognized values must be
+ * silently ignored.
+ */
+ break;
+ }
+ }
} else
nxt = ip6->ip6_nxt;
OpenPOWER on IntegriCloud