diff options
Diffstat (limited to 'net/ipv4/ip_options.c')
-rw-r--r-- | net/ipv4/ip_options.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index ed194d46c00e..32a35043c9f5 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
@@ -251,8 +251,9 @@ static void spec_dst_fill(__be32 *spec_dst, struct sk_buff *skb) | |||
251 | * If opt == NULL, then skb->data should point to IP header. | 251 | * If opt == NULL, then skb->data should point to IP header. |
252 | */ | 252 | */ |
253 | 253 | ||
254 | int ip_options_compile(struct net *net, | 254 | int __ip_options_compile(struct net *net, |
255 | struct ip_options *opt, struct sk_buff *skb) | 255 | struct ip_options *opt, struct sk_buff *skb, |
256 | __be32 *info) | ||
256 | { | 257 | { |
257 | __be32 spec_dst = htonl(INADDR_ANY); | 258 | __be32 spec_dst = htonl(INADDR_ANY); |
258 | unsigned char *pp_ptr = NULL; | 259 | unsigned char *pp_ptr = NULL; |
@@ -468,11 +469,22 @@ eol: | |||
468 | return 0; | 469 | return 0; |
469 | 470 | ||
470 | error: | 471 | error: |
471 | if (skb) { | 472 | if (info) |
472 | icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl((pp_ptr-iph)<<24)); | 473 | *info = htonl((pp_ptr-iph)<<24); |
473 | } | ||
474 | return -EINVAL; | 474 | return -EINVAL; |
475 | } | 475 | } |
476 | |||
477 | int ip_options_compile(struct net *net, | ||
478 | struct ip_options *opt, struct sk_buff *skb) | ||
479 | { | ||
480 | int ret; | ||
481 | __be32 info; | ||
482 | |||
483 | ret = __ip_options_compile(net, opt, skb, &info); | ||
484 | if (ret != 0 && skb) | ||
485 | icmp_send(skb, ICMP_PARAMETERPROB, 0, info); | ||
486 | return ret; | ||
487 | } | ||
476 | EXPORT_SYMBOL(ip_options_compile); | 488 | EXPORT_SYMBOL(ip_options_compile); |
477 | 489 | ||
478 | /* | 490 | /* |