This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
sysctl patch. Was [ECOS] How to print IP routing table with eCOS ?
- From: Andrew Lunn <andrew at lunn dot ch>
- To: eCos Patches <ecos-patches at sources dot redhat dot com>
- Cc: Sebastien Couret <sebastien dot couret at elios-informatique dot fr>
- Date: Sat, 8 Nov 2003 15:40:07 +0100
- Subject: sysctl patch. Was [ECOS] How to print IP routing table with eCOS ?
- References: <E1AHR1q-0002Wa-00@ECoSyst3m3>
There is a bug in sysclt which means it does not updated the oldlen
value at the end of the call. This caused the example code to retrieve
the routing table to fail.
Andrew
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/ChangeLog,v
retrieving revision 1.35
diff -u -r1.35 ChangeLog
--- ChangeLog 3 Nov 2003 14:57:33 -0000 1.35
+++ ChangeLog 8 Nov 2003 14:36:35 -0000
@@ -1,3 +1,8 @@
+2003-11-08 Andrew Lunn <andrew.lunn@ascom.ch>
+
+ * src/sys/kern/kern_sysctl.c (sysctl): Update the oldlen value at
+ the end of the sysctl call.
+
2003-10-28 Matt Jerdonek <maj1224@yahoo.com>
* src/sys/netinet/tcp_output.c (tcp_setpersist): Use variable
Index: src/sys/kern/kern_sysctl.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/src/sys/kern/kern_sysctl.c,v
retrieving revision 1.1
diff -u -r1.1 kern_sysctl.c
--- src/sys/kern/kern_sysctl.c 30 Jul 2003 07:42:32 -0000 1.1
+++ src/sys/kern/kern_sysctl.c 8 Nov 2003 14:36:37 -0000
@@ -979,6 +979,10 @@
return -1;
}
+ if (oldlenp) {
+ *oldlenp = req.oldidx;
+ }
+
if (req.oldptr && req.oldidx > req.oldlen)
retval = req.oldlen;
else