Implement RFC 5095 more fully. Rather than marking this no-op code as
BURN_BRIDGES, just remove it. Adjust comments. Reviewed by: dwhite, emaste, battlez
This commit is contained in:
parent
deb1daa82e
commit
71ce264c94
@ -435,34 +435,11 @@ skip_ipsec2:;
|
||||
#endif /* IPSEC */
|
||||
|
||||
/*
|
||||
* If there is a routing header, replace the destination address field
|
||||
* with the first hop of the routing header.
|
||||
* If there is a routing header, discard the packet.
|
||||
*/
|
||||
if (exthdrs.ip6e_rthdr) {
|
||||
struct ip6_rthdr *rh =
|
||||
(struct ip6_rthdr *)(mtod(exthdrs.ip6e_rthdr,
|
||||
struct ip6_rthdr *));
|
||||
|
||||
/*
|
||||
* While this switch may look gratuitous, leave it in
|
||||
* in favour of RH2 implementations, etc.
|
||||
*/
|
||||
switch (rh->ip6r_type) {
|
||||
#ifndef BURN_BRIDGES
|
||||
case IPV6_RTHDR_TYPE_0:
|
||||
/*
|
||||
* According to RFC 5095 we should not implement
|
||||
* it in any way but we may want to give the user
|
||||
* a hint for now.
|
||||
*/
|
||||
log(LOG_INFO, "[%s:%d] IPv6 Type 0 Routing Headers are "
|
||||
"deprecated.\n", __func__, __LINE__);
|
||||
/* FALLTHROUGH */
|
||||
#endif
|
||||
default: /* is it possible? */
|
||||
error = EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
error = EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* Source address validation */
|
||||
|
@ -95,15 +95,6 @@ route6_input(struct mbuf **mp, int *offp, int proto)
|
||||
* in favour of RH2 implementations, etc.
|
||||
*/
|
||||
switch (rh->ip6r_type) {
|
||||
#ifndef BURN_BRIDGES
|
||||
case IPV6_RTHDR_TYPE_0:
|
||||
/*
|
||||
* According to RFC 5095, 3. Deprecation of RH0,
|
||||
* we must handle RH0 like the default (unknown
|
||||
* routing header type) case.
|
||||
*/
|
||||
/* FALLTHROUGH */
|
||||
#endif
|
||||
default:
|
||||
/* Unknown routing header type. */
|
||||
if (rh->ip6r_segleft == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user