Wolfgang Grandegger wrote:
This patch allows to disable the RTnet IPv4 ICMP support, which might
be useful when using the RTnet-Proxy add-on. ICMP will then be handled
by the Linux network stack. ICMP support in RTnet is enabled by default
and it can be disabled with the configure option "--disable-icmp".

Note: this patch requires running "scripts/autogen.sh"

Signed-off-by: Wolfang Grandegger <[EMAIL PROTECTED]>
Index: rtnet/stack/ipv4/af_inet.c
===================================================================
--- rtnet.orig/stack/ipv4/af_inet.c
+++ rtnet/stack/ipv4/af_inet.c
@@ -79,6 +79,7 @@ static void cleanup_route_solicit(void *
+#ifdef CONFIG_RTNET_RTIPV4_ICMP
 static int ping_handler(struct rt_proc_call *call)
 {
     struct ipv4_cmd *cmd;
@@ -114,6 +115,7 @@ static void ping_complete_handler(struct
     usr_cmd->args.ping.ip_addr = cmd->args.ping.ip_addr;
     usr_cmd->args.ping.rtt     = cmd->args.ping.rtt;
 }
+#endif /* CONFIG_RTNET_RTIPV4_ICMP */
@@ -187,6 +189,7 @@ static int ipv4_ioctl(struct rtnet_devic
             break;
 #endif /* CONFIG_RTNET_RTIPV4_NETROUTING */
+#ifdef CONFIG_RTNET_RTIPV4_ICMP
         case IOC_RT_PING:
             ret = rtpc_dispatch_call(ping_handler, cmd.args.ping.timeout, &cmd,
                                      sizeof(cmd), ping_complete_handler, NULL);
@@ -197,6 +200,7 @@ static int ipv4_ioctl(struct rtnet_devic
             if (ret < 0)
                 rt_icmp_cleanup_echo_requests();
             break;
+#endif /* CONFIG_RTNET_RTIPV4_ICMP */
default:
             ret = -ENOTTY;
@@ -338,7 +342,9 @@ int __init rt_ipv4_proto_init(void)
     for (i=0; i<MAX_RT_INET_PROTOCOLS; i++)
         rt_inet_protocols[i]=NULL;
+#ifdef CONFIG_RTNET_RTIPV4_ICMP
     rt_icmp_init();
+#endif /* CONFIG_RTNET_RTIPV4_ICMP */

To reduce ifdefs, rt_icmp_init/release should be wrapped at header-level to an empty inline function in the !CONFIG_RTNET_RTIPV4_ICMP case. Otherwise I'm fine with this patch, just also add kconfig support, please.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
RTnet-users mailing list
RTnet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtnet-users

Reply via email to