[ATM]: Kill ipcommon.[ch]
[safe/jmp/linux-2.6] / net / ipv6 / ipv6_sockglue.c
index 4f3bb7f..1eafcfc 100644 (file)
@@ -51,6 +51,7 @@
 #include <net/inet_common.h>
 #include <net/tcp.h>
 #include <net/udp.h>
+#include <net/udplite.h>
 #include <net/xfrm.h>
 
 #include <asm/uaccess.h>
@@ -123,6 +124,9 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
        struct ipv6hdr *ipv6h;
        struct inet6_protocol *ops;
 
+       if (!(features & NETIF_F_HW_CSUM))
+               features &= ~NETIF_F_SG;
+
        if (unlikely(skb_shinfo(skb)->gso_type &
                     ~(SKB_GSO_UDP |
                       SKB_GSO_DODGY |
@@ -236,6 +240,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                        struct sk_buff *pktopt;
 
                        if (sk->sk_protocol != IPPROTO_UDP &&
+                           sk->sk_protocol != IPPROTO_UDPLITE &&
                            sk->sk_protocol != IPPROTO_TCP)
                                break;
 
@@ -273,11 +278,15 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
                                sk->sk_family = PF_INET;
                                tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
                        } else {
+                               struct proto *prot = &udp_prot;
+
+                               if (sk->sk_protocol == IPPROTO_UDPLITE)
+                                       prot = &udplite_prot;
                                local_bh_disable();
                                sock_prot_dec_use(sk->sk_prot);
-                               sock_prot_inc_use(&udp_prot);
+                               sock_prot_inc_use(prot);
                                local_bh_enable();
-                               sk->sk_prot = &udp_prot;
+                               sk->sk_prot = prot;
                                sk->sk_socket->ops = &inet_dgram_ops;
                                sk->sk_family = PF_INET;
                        }
@@ -810,6 +819,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
        switch (optname) {
        case IPV6_ADDRFORM:
                if (sk->sk_protocol != IPPROTO_UDP &&
+                   sk->sk_protocol != IPPROTO_UDPLITE &&
                    sk->sk_protocol != IPPROTO_TCP)
                        return -EINVAL;
                if (sk->sk_state != TCP_ESTABLISHED)