inet: constify ip headers and in6_addr
[deliverable/linux.git] / net / xfrm / xfrm_state.c
index f83a3d1da81b90ec382918e4b5b193a150b99211..d70f85eb7864f4e35326f41d63c49cc163296b05 100644 (file)
@@ -1036,15 +1036,15 @@ static struct xfrm_state *__find_acq_core(struct net *net, struct xfrm_mark *m,
 
                case AF_INET6:
                        ipv6_addr_copy((struct in6_addr *)x->sel.daddr.a6,
-                                      (struct in6_addr *)daddr);
+                                      (const struct in6_addr *)daddr);
                        ipv6_addr_copy((struct in6_addr *)x->sel.saddr.a6,
-                                      (struct in6_addr *)saddr);
+                                      (const struct in6_addr *)saddr);
                        x->sel.prefixlen_d = 128;
                        x->sel.prefixlen_s = 128;
                        ipv6_addr_copy((struct in6_addr *)x->props.saddr.a6,
-                                      (struct in6_addr *)saddr);
+                                      (const struct in6_addr *)saddr);
                        ipv6_addr_copy((struct in6_addr *)x->id.daddr.a6,
-                                      (struct in6_addr *)daddr);
+                                      (const struct in6_addr *)daddr);
                        break;
                }
 
@@ -1181,6 +1181,12 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
                        goto error;
        }
 
+       if (orig->replay_esn) {
+               err = xfrm_replay_clone(x, orig);
+               if (err)
+                       goto error;
+       }
+
        memcpy(&x->mark, &orig->mark, sizeof(x->mark));
 
        err = xfrm_init_state(x);
@@ -2086,8 +2092,8 @@ static void xfrm_audit_helper_sainfo(struct xfrm_state *x,
 static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family,
                                      struct audit_buffer *audit_buf)
 {
-       struct iphdr *iph4;
-       struct ipv6hdr *iph6;
+       const struct iphdr *iph4;
+       const struct ipv6hdr *iph6;
 
        switch (family) {
        case AF_INET:
This page took 0.02713 seconds and 5 git commands to generate.