diff options
| -rw-r--r-- | net/ipv6/tcp_ipv6.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 3e012e229b92..21b165ec5339 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -579,7 +579,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, addr_type = ipv6_addr_type(&usin->sin6_addr); - if (addr_type & (IPV6_ADDR_ANYCAST | IPV6_ADDR_MULTICAST)) + if(addr_type & IPV6_ADDR_MULTICAST) return -ENETUNREACH; if (addr_type&IPV6_ADDR_LINKLOCAL) { @@ -967,14 +967,12 @@ static void tcp_v6_send_reset(struct sk_buff *skb) struct tcphdr *th = skb->h.th, *t1; struct sk_buff *buff; struct flowi fl; - int daddr_type; if (th->rst) return; - daddr_type = ipv6_addr_type(&skb->nh.ipv6h->daddr); - if (daddr_type & (IPV6_ADDR_ANYCAST | IPV6_ADDR_MULTICAST)) - return; + if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr)) + return; /* * We need to grab some memory, and put together an RST, @@ -1173,14 +1171,13 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) struct tcp_opt tmptp, *tp = tcp_sk(sk); struct open_request *req = NULL; __u32 isn = TCP_SKB_CB(skb)->when; - int daddr_type; if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_conn_request(sk, skb); - daddr_type = ipv6_addr_type(&skb->nh.ipv6h->daddr); - if (daddr_type & (IPV6_ADDR_ANYCAST | IPV6_ADDR_MULTICAST)) - goto drop; + /* FIXME: do the same check for anycast */ + if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr)) + goto drop; /* * There are no SYN attacks on IPv6, yet... |
