I added a file under /proc for Proc file system. When our FDB mac
entries are higher (around 1K entries) it crashes, I couldn't able to
figureout the problem. This is working for 256 entries, if the MAC
entries are more than 1K then crashes. Appreciated for help.
static int proc_read_arlentry(char *page, char **start,
off_t off, int count,
int *eof, void *data)
{
int len =0;
arl_entry_t arl_entry;
u32 first = 1;
do{
if(get_arl_entry (&arl_entry, first) == 0){ //valid MAC
len += sprintf(page+len, "MAC Addr:\t
%02x:%02x:%02x:%02x:%02x:%02x\n",
arl_entry.mac[0],
arl_entry.mac[1],
arl_entry.mac[2],
arl_entry.mac[3],
arl_entry.mac[4],
arl_entry.mac[5]);
len += sprintf(page+len, "ARL Flag:\t 0x%lx\n", arl_entry.flag);
}
first = 0;
}while(!(arl_entry.flag & 0x01)); // end of table
//*eof = 1;
*start = page+off;
len -= off;
if (len < count) {
*eof = 1;
if(len <= 0)
return 0;
} else
len = count;
return len;
}
|