Re: Patch to 2.0.32 to enable icmp mask queries.

Mark Harvey (markh@forcetech.com.au)
Mon, 15 Dec 1997 10:29:05 +1100


This is a multi-part message in MIME format.
--------------A9738E98A30C17FAA8E54E07
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Tring again.... :-(

This time I hope the patch makes it.

Best regards
Mark Harvey
--------------A9738E98A30C17FAA8E54E07
Content-Type: text/plain; charset=us-ascii; name="icmp.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="icmp.diff"

--- linux/net/ipv4/icmp.c.orig Tue Sep 16 02:54:52 1997
+++ linux/net/ipv4/icmp.c Thu Dec 11 08:48:08 1997
@@ -965,18 +965,21 @@

static void icmp_address(struct icmphdr *icmph, struct sk_buff *skb, struct device *dev, __u32 saddr, __u32 daddr, int len)
{
-#ifdef CONFIG_IP_ADDR_AGENT /* Don't use, broken */
+#ifndef CONFIG_IP_ADDR_AGENT
struct icmp_bxm icmp_param;
icmp_param.icmph.type=ICMP_ADDRESSREPLY;
icmp_param.icmph.code=0;
icmp_param.icmph.un.echo.id = icmph->un.echo.id;
icmp_param.icmph.un.echo.sequence = icmph->un.echo.sequence;
- icmp_param.data_ptr=&dev->pa_mask;
- icmp_param.data_len=4;
- if (ip_options_echo(&icmp_param.replyopts, NULL, daddr, saddr, skb)==0)
- icmp_build_xmit(&icmp_param, daddr, saddr, skb->iph->tos);
-#endif
- kfree_skb(skb, FREE_READ);
+ dev = ip_dev_find(daddr);
+ if (dev != NULL) {
+ icmp_param.data_ptr=&dev->pa_mask;
+ icmp_param.data_len=4;
+ if (ip_options_echo(&icmp_param.replyopts, NULL, daddr, saddr, skb)==0)
+ icmp_build_xmit(&icmp_param, daddr, saddr, skb->ip_hdr->tos);
+ }
+#endif
+ kfree_skb(skb, FREE_READ);
}

static void icmp_discard(struct icmphdr *icmph, struct sk_buff *skb, struct device *dev, __u32 saddr, __u32 daddr, int len)

--------------A9738E98A30C17FAA8E54E07--