|
|
@@ -251,8 +251,9 @@ static void spec_dst_fill(__be32 *spec_dst, struct sk_buff *skb)
|
|
|
* If opt == NULL, then skb->data should point to IP header.
|
|
|
*/
|
|
|
|
|
|
-int ip_options_compile(struct net *net,
|
|
|
- struct ip_options *opt, struct sk_buff *skb)
|
|
|
+int __ip_options_compile(struct net *net,
|
|
|
+ struct ip_options *opt, struct sk_buff *skb,
|
|
|
+ __be32 *info)
|
|
|
{
|
|
|
__be32 spec_dst = htonl(INADDR_ANY);
|
|
|
unsigned char *pp_ptr = NULL;
|
|
|
@@ -468,11 +469,22 @@ eol:
|
|
|
return 0;
|
|
|
|
|
|
error:
|
|
|
- if (skb) {
|
|
|
- icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl((pp_ptr-iph)<<24));
|
|
|
- }
|
|
|
+ if (info)
|
|
|
+ *info = htonl((pp_ptr-iph)<<24);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
+
|
|
|
+int ip_options_compile(struct net *net,
|
|
|
+ struct ip_options *opt, struct sk_buff *skb)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+ __be32 info;
|
|
|
+
|
|
|
+ ret = __ip_options_compile(net, opt, skb, &info);
|
|
|
+ if (ret != 0 && skb)
|
|
|
+ icmp_send(skb, ICMP_PARAMETERPROB, 0, info);
|
|
|
+ return ret;
|
|
|
+}
|
|
|
EXPORT_SYMBOL(ip_options_compile);
|
|
|
|
|
|
/*
|