提交 d66a8acb 编写于 作者: P Piotr Sawicki 提交者: Casey Schaufler

Smack: Inform peer that IPv6 traffic has been blocked

In this patch we're sending an ICMPv6 message to a peer to
immediately inform it that making a connection is not possible.
In case of TCP connections, without this change, the peer
will be waiting until a connection timeout is exceeded.
Signed-off-by: NPiotr Sawicki <p.sawicki2@partner.samsung.com>
Signed-off-by: NCasey Schaufler <casey@schaufler-ca.com>
上级 a07ef951
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/tcp.h> #include <linux/tcp.h>
#include <linux/udp.h> #include <linux/udp.h>
#include <linux/dccp.h> #include <linux/dccp.h>
#include <linux/icmpv6.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/pipe_fs_i.h> #include <linux/pipe_fs_i.h>
...@@ -4009,6 +4010,9 @@ static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) ...@@ -4009,6 +4010,9 @@ static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
#ifdef SMACK_IPV6_PORT_LABELING #ifdef SMACK_IPV6_PORT_LABELING
rc = smk_ipv6_port_check(sk, &sadd, SMK_RECEIVING); rc = smk_ipv6_port_check(sk, &sadd, SMK_RECEIVING);
#endif /* SMACK_IPV6_PORT_LABELING */ #endif /* SMACK_IPV6_PORT_LABELING */
if (rc != 0)
icmpv6_send(skb, ICMPV6_DEST_UNREACH,
ICMPV6_ADM_PROHIBITED, 0);
break; break;
#endif /* CONFIG_IPV6 */ #endif /* CONFIG_IPV6 */
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册