netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf-next] add missing icmpv6 codes (rfc4443) in REJECT
@ 2015-08-21  8:59 Andreas Herz
  2015-08-21  9:01 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Herz @ 2015-08-21  8:59 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Andreas Herz

RFC 4443 added two new codes values for ICMPv6 type 1:

 5 - Source address failed ingress/egress policy
 6 - Reject route to destination

And RFC 7084 states in L-14 that IPv6 Router MUST send ICMPv6 Destination
Unreachable with code 5 for packets forwarded to it that use an address 
from a prefix that has been invalidated.

Signed-off-by: Andreas Herz <andi@geekosphere.org>
---
 include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h | 2 ++
 net/ipv6/netfilter/ip6t_REJECT.c                | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h b/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h
index 205ed62..8bd5f4b 100644
--- a/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h
@@ -9,6 +9,8 @@ enum ip6t_reject_with {
 	IP6T_ICMP6_NOT_NEIGHBOUR,
 	IP6T_ICMP6_ADDR_UNREACH,
 	IP6T_ICMP6_PORT_UNREACH,
+	IP6T_ICMP6_POLICY_FAIL,
+	IP6T_ICMP6_REJECT_ROUTE,
 	IP6T_ICMP6_ECHOREPLY,
 	IP6T_TCP_RESET
 };
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index 567367a..d39b647 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -57,6 +57,12 @@ reject_tg6(struct sk_buff *skb, const struct xt_action_param *par)
 	case IP6T_ICMP6_PORT_UNREACH:
 		nf_send_unreach6(net, skb, ICMPV6_PORT_UNREACH, par->hooknum);
 		break;
+	case IP6T_ICMP6_POLICY_FAIL:
+		nf_send_unreach6(net, skb, ICMPV6_POLICY_FAIL, par->hooknum);
+		break;
+	case IP6T_ICMP6_REJECT_ROUTE:
+		nf_send_unreach6(net, skb, ICMPV6_REJECT_ROUTE, par->hooknum);
+		break;
 	case IP6T_ICMP6_ECHOREPLY:
 		/* Do nothing */
 		break;
-- 
2.4.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH nf-next] add missing icmpv6 codes (rfc4443) in REJECT
  2015-08-21  8:59 [PATCH nf-next] add missing icmpv6 codes (rfc4443) in REJECT Andreas Herz
@ 2015-08-21  9:01 ` Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2015-08-21  9:01 UTC (permalink / raw)
  To: Andreas Herz; +Cc: netfilter-devel

Andreas Herz <andi@geekosphere.org> wrote:
> RFC 4443 added two new codes values for ICMPv6 type 1:
> 
>  5 - Source address failed ingress/egress policy
>  6 - Reject route to destination
> 
> And RFC 7084 states in L-14 that IPv6 Router MUST send ICMPv6 Destination
> Unreachable with code 5 for packets forwarded to it that use an address 
> from a prefix that has been invalidated.
> 
> Signed-off-by: Andreas Herz <andi@geekosphere.org>
> ---
>  include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h | 2 ++
>  net/ipv6/netfilter/ip6t_REJECT.c                | 6 ++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h b/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h
> index 205ed62..8bd5f4b 100644
> --- a/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h
> +++ b/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h
> @@ -9,6 +9,8 @@ enum ip6t_reject_with {
>  	IP6T_ICMP6_NOT_NEIGHBOUR,
>  	IP6T_ICMP6_ADDR_UNREACH,
>  	IP6T_ICMP6_PORT_UNREACH,
> +	IP6T_ICMP6_POLICY_FAIL,
> +	IP6T_ICMP6_REJECT_ROUTE,
>  	IP6T_ICMP6_ECHOREPLY,
>  	IP6T_TCP_RESET
>  };

I'm afraid we'll have to append these at the end, else we break abi --
new kernel would use IP6T_ICMP6_POLICY_FAIL if old userspace asked for
IP6T_ICMP6_ECHOREPLY...


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-21  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-21  8:59 [PATCH nf-next] add missing icmpv6 codes (rfc4443) in REJECT Andreas Herz
2015-08-21  9:01 ` Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).