]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/af_inet.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/x86
[linux-2.6-omap-h63xx.git] / net / ipv4 / af_inet.c
index 041fba3fa0aa312c3ff1e2de35b81bb8025d19aa..621b128897d7af80015506b4ae7abb8116ad6d23 100644 (file)
@@ -241,7 +241,7 @@ EXPORT_SYMBOL(build_ehash_secret);
  *     Create an inet socket.
  */
 
-static int inet_create(struct socket *sock, int protocol)
+static int inet_create(struct net *net, struct socket *sock, int protocol)
 {
        struct sock *sk;
        struct list_head *p;
@@ -253,6 +253,9 @@ static int inet_create(struct socket *sock, int protocol)
        int try_loading_module = 0;
        int err;
 
+       if (net != &init_net)
+               return -EAFNOSUPPORT;
+
        if (sock->type != SOCK_RAW &&
            sock->type != SOCK_DGRAM &&
            !inet_ehash_secret)
@@ -320,7 +323,7 @@ lookup_protocol:
        BUG_TRAP(answer_prot->slab != NULL);
 
        err = -ENOBUFS;
-       sk = sk_alloc(PF_INET, GFP_KERNEL, answer_prot, 1);
+       sk = sk_alloc(net, PF_INET, GFP_KERNEL, answer_prot, 1);
        if (sk == NULL)
                goto out;
 
@@ -831,7 +834,7 @@ const struct proto_ops inet_stream_ops = {
        .shutdown          = inet_shutdown,
        .setsockopt        = sock_common_setsockopt,
        .getsockopt        = sock_common_getsockopt,
-       .sendmsg           = inet_sendmsg,
+       .sendmsg           = tcp_sendmsg,
        .recvmsg           = sock_common_recvmsg,
        .mmap              = sock_no_mmap,
        .sendpage          = tcp_sendpage,
@@ -939,7 +942,7 @@ static struct inet_protosw inetsw_array[] =
        }
 };
 
-#define INETSW_ARRAY_LEN (sizeof(inetsw_array) / sizeof(struct inet_protosw))
+#define INETSW_ARRAY_LEN ARRAY_SIZE(inetsw_array)
 
 void inet_register_protosw(struct inet_protosw *p)
 {
@@ -1170,6 +1173,9 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
        int ihl;
        int id;
 
+       if (!(features & NETIF_F_V4_CSUM))
+               features &= ~NETIF_F_SG;
+
        if (unlikely(skb_shinfo(skb)->gso_type &
                     ~(SKB_GSO_TCPV4 |
                       SKB_GSO_UDP |
@@ -1296,6 +1302,10 @@ static int __init init_ipv4_mibs(void)
                          sizeof(struct icmp_mib),
                          __alignof__(struct icmp_mib)) < 0)
                goto err_icmp_mib;
+       if (snmp_mib_init((void **)icmpmsg_statistics,
+                         sizeof(struct icmpmsg_mib),
+                         __alignof__(struct icmpmsg_mib)) < 0)
+               goto err_icmpmsg_mib;
        if (snmp_mib_init((void **)tcp_statistics,
                          sizeof(struct tcp_mib),
                          __alignof__(struct tcp_mib)) < 0)
@@ -1318,6 +1328,8 @@ err_udplite_mib:
 err_udp_mib:
        snmp_mib_free((void **)tcp_statistics);
 err_tcp_mib:
+       snmp_mib_free((void **)icmpmsg_statistics);
+err_icmpmsg_mib:
        snmp_mib_free((void **)icmp_statistics);
 err_icmp_mib:
        snmp_mib_free((void **)ip_statistics);