aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mip6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/mip6.c')
-rw-r--r--net/ipv6/mip6.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index bb4033553f3b..7b5f9d82e801 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -129,7 +129,7 @@ static struct mip6_report_rate_limiter mip6_report_rl = {
129 129
130static int mip6_destopt_input(struct xfrm_state *x, struct sk_buff *skb) 130static int mip6_destopt_input(struct xfrm_state *x, struct sk_buff *skb)
131{ 131{
132 struct ipv6hdr *iph = skb->nh.ipv6h; 132 struct ipv6hdr *iph = ipv6_hdr(skb);
133 struct ipv6_destopt_hdr *destopt = (struct ipv6_destopt_hdr *)skb->data; 133 struct ipv6_destopt_hdr *destopt = (struct ipv6_destopt_hdr *)skb->data;
134 134
135 if (!ipv6_addr_equal(&iph->saddr, (struct in6_addr *)x->coaddr) && 135 if (!ipv6_addr_equal(&iph->saddr, (struct in6_addr *)x->coaddr) &&
@@ -223,16 +223,16 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct
223 223
224 skb_get_timestamp(skb, &stamp); 224 skb_get_timestamp(skb, &stamp);
225 225
226 if (!mip6_report_rl_allow(&stamp, &skb->nh.ipv6h->daddr, 226 if (!mip6_report_rl_allow(&stamp, &ipv6_hdr(skb)->daddr,
227 hao ? &hao->addr : &skb->nh.ipv6h->saddr, 227 hao ? &hao->addr : &ipv6_hdr(skb)->saddr,
228 opt->iif)) 228 opt->iif))
229 goto out; 229 goto out;
230 230
231 memset(&sel, 0, sizeof(sel)); 231 memset(&sel, 0, sizeof(sel));
232 memcpy(&sel.daddr, (xfrm_address_t *)&skb->nh.ipv6h->daddr, 232 memcpy(&sel.daddr, (xfrm_address_t *)&ipv6_hdr(skb)->daddr,
233 sizeof(sel.daddr)); 233 sizeof(sel.daddr));
234 sel.prefixlen_d = 128; 234 sel.prefixlen_d = 128;
235 memcpy(&sel.saddr, (xfrm_address_t *)&skb->nh.ipv6h->saddr, 235 memcpy(&sel.saddr, (xfrm_address_t *)&ipv6_hdr(skb)->saddr,
236 sizeof(sel.saddr)); 236 sizeof(sel.saddr));
237 sel.prefixlen_s = 128; 237 sel.prefixlen_s = 128;
238 sel.family = AF_INET6; 238 sel.family = AF_INET6;
@@ -256,12 +256,13 @@ static int mip6_destopt_offset(struct xfrm_state *x, struct sk_buff *skb,
256 u8 **nexthdr) 256 u8 **nexthdr)
257{ 257{
258 u16 offset = sizeof(struct ipv6hdr); 258 u16 offset = sizeof(struct ipv6hdr);
259 struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.ipv6h + 1); 259 struct ipv6_opt_hdr *exthdr =
260 (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1);
260 const unsigned char *nh = skb_network_header(skb); 261 const unsigned char *nh = skb_network_header(skb);
261 unsigned int packet_len = skb->tail - nh; 262 unsigned int packet_len = skb->tail - nh;
262 int found_rhdr = 0; 263 int found_rhdr = 0;
263 264
264 *nexthdr = &skb->nh.ipv6h->nexthdr; 265 *nexthdr = &ipv6_hdr(skb)->nexthdr;
265 266
266 while (offset + 1 <= packet_len) { 267 while (offset + 1 <= packet_len) {
267 268
@@ -387,12 +388,13 @@ static int mip6_rthdr_offset(struct xfrm_state *x, struct sk_buff *skb,
387 u8 **nexthdr) 388 u8 **nexthdr)
388{ 389{
389 u16 offset = sizeof(struct ipv6hdr); 390 u16 offset = sizeof(struct ipv6hdr);
390 struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.ipv6h + 1); 391 struct ipv6_opt_hdr *exthdr =
392 (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1);
391 const unsigned char *nh = skb_network_header(skb); 393 const unsigned char *nh = skb_network_header(skb);
392 unsigned int packet_len = skb->tail - nh; 394 unsigned int packet_len = skb->tail - nh;
393 int found_rhdr = 0; 395 int found_rhdr = 0;
394 396
395 *nexthdr = &skb->nh.ipv6h->nexthdr; 397 *nexthdr = &ipv6_hdr(skb)->nexthdr;
396 398
397 while (offset + 1 <= packet_len) { 399 while (offset + 1 <= packet_len) {
398 400