netns: net_identifiers should be read_mostly
[deliverable/linux.git] / drivers / net / pppol2tp.c
index e0f9219a0aea8b60927d3ec0ef6861d8b1880261..442c382c2c850f4940f49cd0bbb63ae14d10e717 100644 (file)
@@ -229,10 +229,10 @@ static void pppol2tp_tunnel_free(struct pppol2tp_tunnel *tunnel);
 static atomic_t pppol2tp_tunnel_count;
 static atomic_t pppol2tp_session_count;
 static struct ppp_channel_ops pppol2tp_chan_ops = { pppol2tp_xmit , NULL };
-static struct proto_ops pppol2tp_ops;
+static const struct proto_ops pppol2tp_ops;
 
 /* per-net private data for this module */
-static int pppol2tp_net_id;
+static int pppol2tp_net_id __read_mostly;
 struct pppol2tp_net {
        struct list_head pppol2tp_tunnel_list;
        rwlock_t pppol2tp_tunnel_list_lock;
@@ -516,7 +516,7 @@ static inline int pppol2tp_verify_udp_checksum(struct sock *sk,
                return 0;
 
        inet = inet_sk(sk);
-       psum = csum_tcpudp_nofold(inet->saddr, inet->daddr, ulen,
+       psum = csum_tcpudp_nofold(inet->inet_saddr, inet->inet_daddr, ulen,
                                  IPPROTO_UDP, 0);
 
        if ((skb->ip_summed == CHECKSUM_COMPLETE) &&
@@ -949,8 +949,8 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
        inet = inet_sk(sk_tun);
        udp_len = hdr_len + sizeof(ppph) + total_len;
        uh = (struct udphdr *) skb->data;
-       uh->source = inet->sport;
-       uh->dest = inet->dport;
+       uh->source = inet->inet_sport;
+       uh->dest = inet->inet_dport;
        uh->len = htons(udp_len);
        uh->check = 0;
        skb_put(skb, sizeof(struct udphdr));
@@ -978,7 +978,8 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
        else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) {
                skb->ip_summed = CHECKSUM_COMPLETE;
                csum = skb_checksum(skb, 0, udp_len, 0);
-               uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr,
+               uh->check = csum_tcpudp_magic(inet->inet_saddr,
+                                             inet->inet_daddr,
                                              udp_len, IPPROTO_UDP, csum);
                if (uh->check == 0)
                        uh->check = CSUM_MANGLED_0;
@@ -986,7 +987,8 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
                skb->ip_summed = CHECKSUM_PARTIAL;
                skb->csum_start = skb_transport_header(skb) - skb->head;
                skb->csum_offset = offsetof(struct udphdr, check);
-               uh->check = ~csum_tcpudp_magic(inet->saddr, inet->daddr,
+               uh->check = ~csum_tcpudp_magic(inet->inet_saddr,
+                                              inet->inet_daddr,
                                               udp_len, IPPROTO_UDP, 0);
        }
 
@@ -1136,8 +1138,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
        __skb_push(skb, sizeof(*uh));
        skb_reset_transport_header(skb);
        uh = udp_hdr(skb);
-       uh->source = inet->sport;
-       uh->dest = inet->dport;
+       uh->source = inet->inet_sport;
+       uh->dest = inet->inet_dport;
        uh->len = htons(udp_len);
        uh->check = 0;
 
@@ -1181,7 +1183,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
        else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) {
                skb->ip_summed = CHECKSUM_COMPLETE;
                csum = skb_checksum(skb, 0, udp_len, 0);
-               uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr,
+               uh->check = csum_tcpudp_magic(inet->inet_saddr,
+                                             inet->inet_daddr,
                                              udp_len, IPPROTO_UDP, csum);
                if (uh->check == 0)
                        uh->check = CSUM_MANGLED_0;
@@ -1189,7 +1192,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
                skb->ip_summed = CHECKSUM_PARTIAL;
                skb->csum_start = skb_transport_header(skb) - skb->head;
                skb->csum_offset = offsetof(struct udphdr, check);
-               uh->check = ~csum_tcpudp_magic(inet->saddr, inet->daddr,
+               uh->check = ~csum_tcpudp_magic(inet->inet_saddr,
+                                              inet->inet_daddr,
                                               udp_len, IPPROTO_UDP, 0);
        }
 
@@ -2179,7 +2183,7 @@ static int pppol2tp_session_setsockopt(struct sock *sk,
  * session or the special tunnel type.
  */
 static int pppol2tp_setsockopt(struct socket *sock, int level, int optname,
-                              char __user *optval, int optlen)
+                              char __user *optval, unsigned int optlen)
 {
        struct sock *sk = sock->sk;
        struct pppol2tp_session *session = sk->sk_user_data;
@@ -2574,7 +2578,7 @@ static const struct file_operations pppol2tp_proc_fops = {
  * Init and cleanup
  *****************************************************************************/
 
-static struct proto_ops pppol2tp_ops = {
+static const struct proto_ops pppol2tp_ops = {
        .family         = AF_PPPOX,
        .owner          = THIS_MODULE,
        .release        = pppol2tp_release,
This page took 0.031523 seconds and 5 git commands to generate.