Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
[pandora-kernel.git] / net / ipv6 / af_inet6.c
index afcc709..d450a2f 100644 (file)
@@ -272,6 +272,10 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 
        if (addr_len < SIN6_LEN_RFC2133)
                return -EINVAL;
+
+       if (addr->sin6_family != AF_INET6)
+               return -EINVAL;
+
        addr_type = ipv6_addr_type(&addr->sin6_addr);
        if ((addr_type & IPV6_ADDR_MULTICAST) && sock->type == SOCK_STREAM)
                return -EINVAL;
@@ -740,7 +744,7 @@ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
 
 static int ipv6_gso_send_check(struct sk_buff *skb)
 {
-       struct ipv6hdr *ipv6h;
+       const struct ipv6hdr *ipv6h;
        const struct inet6_protocol *ops;
        int err = -EINVAL;