diff options
Diffstat (limited to 'net/ipv4/ip_options.c')
-rw-r--r-- | net/ipv4/ip_options.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index aeed4e5858ec..f0949b42e79e 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
@@ -248,7 +248,8 @@ void ip_options_fragment(struct sk_buff * skb) | |||
248 | * If opt == NULL, then skb->data should point to IP header. | 248 | * If opt == NULL, then skb->data should point to IP header. |
249 | */ | 249 | */ |
250 | 250 | ||
251 | int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) | 251 | int ip_options_compile(struct net *net, |
252 | struct ip_options * opt, struct sk_buff * skb) | ||
252 | { | 253 | { |
253 | int l; | 254 | int l; |
254 | unsigned char * iph; | 255 | unsigned char * iph; |
@@ -389,7 +390,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) | |||
389 | { | 390 | { |
390 | __be32 addr; | 391 | __be32 addr; |
391 | memcpy(&addr, &optptr[optptr[2]-1], 4); | 392 | memcpy(&addr, &optptr[optptr[2]-1], 4); |
392 | if (inet_addr_type(&init_net, addr) == RTN_UNICAST) | 393 | if (inet_addr_type(net, addr) == RTN_UNICAST) |
393 | break; | 394 | break; |
394 | if (skb) | 395 | if (skb) |
395 | timeptr = (__be32*)&optptr[optptr[2]+3]; | 396 | timeptr = (__be32*)&optptr[optptr[2]+3]; |
@@ -512,7 +513,7 @@ static int ip_options_get_finish(struct ip_options **optp, | |||
512 | while (optlen & 3) | 513 | while (optlen & 3) |
513 | opt->__data[optlen++] = IPOPT_END; | 514 | opt->__data[optlen++] = IPOPT_END; |
514 | opt->optlen = optlen; | 515 | opt->optlen = optlen; |
515 | if (optlen && ip_options_compile(opt, NULL)) { | 516 | if (optlen && ip_options_compile(&init_net, opt, NULL)) { |
516 | kfree(opt); | 517 | kfree(opt); |
517 | return -EINVAL; | 518 | return -EINVAL; |
518 | } | 519 | } |