#1119 closed defect (fixed)

sysctl interface is not working

Reported by: thomas.doerfler Owned by: Eric Norum
Priority: highest Milestone: 2
Component: network/legacy Version: 4.6
Severity: critical Keywords:
Cc: bugs@…, thomas.doerfler@… Blocked By:
Blocking:

Description

The sysctl interface allows the application to modify lots of variables used in the network stack. It is not working in rtems-4.6.99.2, because GCC optimization removes the data structures that define the access to these variables.
Reason: the named data structures are marked with the attribute "unused" to avoid "variable unused" warnings. GCC-4 silently removes these variables. Using the attribute "used" instead will fix this.

Release:
4.6.99.x with GCC4.x

Environment:
PowerPC targets (and probably others aswell)

How-To-Repeat:
Tryint to access the variable "TCPCTL_KEEPINTVL" with the following code will fail:

/*

  • try to tweak some network stack variables */

{

int old_keepintvl;
size_t old_keepintvl_size = sizeof(old_keepintvl);
int new_keepintvl = 8;
int name[] = {CTL_NET,PF_INET,IPPROTO_TCP,TCPCTL_KEEPINTVL};
printf("calling sysctl for tcp_keepalive\n");
sc = sysctl(name,sizeof(name)/sizeof(name[0]),

&old_keepintvl,&old_keepintvl_size,
&new_keepintvl,sizeof(new_keepintvl));

printf("sysctl returned %d\n",sc);

}

Attachments (1)

rtems-4.6.99.3_sysctl.diff (2.7 KB) - added by thomas.doerfler on Dec 3, 2006 at 1:31:13 PM.
rtems-4.6.99.3_sysctl.diff

Download all attachments as: .zip

Change History (2)

comment:1 Changed on Sep 12, 2006 at 5:54:25 PM by thomas.doerfler

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: problem has been fixed

Changed on Dec 3, 2006 at 1:31:13 PM by thomas.doerfler

Attachment: rtems-4.6.99.3_sysctl.diff added

rtems-4.6.99.3_sysctl.diff

Note: See TracTickets for help on using tickets.