@@ -129,13 +129,13 @@ static int rpl_do_srh_inline(struct sk_buff *skb, const struct rpl_lwt *rlwt,
129129 struct dst_entry * cache_dst )
130130{
131131 struct ipv6_rpl_sr_hdr * isrh , * csrh ;
132- const struct ipv6hdr * oldhdr ;
132+ struct ipv6hdr oldhdr ;
133133 struct ipv6hdr * hdr ;
134134 unsigned char * buf ;
135135 size_t hdrlen ;
136136 int err ;
137137
138- oldhdr = ipv6_hdr (skb );
138+ memcpy ( & oldhdr , ipv6_hdr (skb ), sizeof ( oldhdr ) );
139139
140140 buf = kcalloc (struct_size (srh , segments .addr , srh -> segments_left ), 2 , GFP_ATOMIC );
141141 if (!buf )
@@ -147,7 +147,7 @@ static int rpl_do_srh_inline(struct sk_buff *skb, const struct rpl_lwt *rlwt,
147147 memcpy (isrh , srh , sizeof (* isrh ));
148148 memcpy (isrh -> rpl_segaddr , & srh -> rpl_segaddr [1 ],
149149 (srh -> segments_left - 1 ) * 16 );
150- isrh -> rpl_segaddr [srh -> segments_left - 1 ] = oldhdr -> daddr ;
150+ isrh -> rpl_segaddr [srh -> segments_left - 1 ] = oldhdr . daddr ;
151151
152152 ipv6_rpl_srh_compress (csrh , isrh , & srh -> rpl_segaddr [0 ],
153153 isrh -> segments_left - 1 );
@@ -169,7 +169,7 @@ static int rpl_do_srh_inline(struct sk_buff *skb, const struct rpl_lwt *rlwt,
169169 skb_mac_header_rebuild (skb );
170170
171171 hdr = ipv6_hdr (skb );
172- memmove (hdr , oldhdr , sizeof (* hdr ));
172+ memmove (hdr , & oldhdr , sizeof (* hdr ));
173173 isrh = (void * )hdr + sizeof (* hdr );
174174 memcpy (isrh , csrh , hdrlen );
175175
0 commit comments