Another fix from vodz
This commit is contained in:
parent
3b1525e444
commit
b9408504f5
@ -15,7 +15,7 @@
|
|||||||
* Foundation; either version 2 of the License, or (at
|
* Foundation; either version 2 of the License, or (at
|
||||||
* your option) any later version.
|
* your option) any later version.
|
||||||
*
|
*
|
||||||
* $Id: route.c,v 1.12 2001/08/27 17:57:27 andersen Exp $
|
* $Id: route.c,v 1.13 2001/09/05 19:32:00 andersen Exp $
|
||||||
*
|
*
|
||||||
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
|
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
|
||||||
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
|
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
|
||||||
@ -370,7 +370,7 @@ static void displayroutes(void)
|
|||||||
struct in_addr gw;
|
struct in_addr gw;
|
||||||
struct in_addr mask;
|
struct in_addr mask;
|
||||||
int flgs, ref, use, metric;
|
int flgs, ref, use, metric;
|
||||||
char flags[4];
|
char flags[64];
|
||||||
unsigned long int d,g,m;
|
unsigned long int d,g,m;
|
||||||
|
|
||||||
char sdest[16], sgw[16];
|
char sdest[16], sgw[16];
|
||||||
@ -384,7 +384,7 @@ static void displayroutes(void)
|
|||||||
while(buff[ifl]!=' ' && buff[ifl]!='\t' && buff[ifl]!='\0')
|
while(buff[ifl]!=' ' && buff[ifl]!='\t' && buff[ifl]!='\0')
|
||||||
ifl++;
|
ifl++;
|
||||||
buff[ifl]=0; /* interface */
|
buff[ifl]=0; /* interface */
|
||||||
if(sscanf(buff+ifl+1, "%lx%lx%d%d%d%d%lx",
|
if(sscanf(buff+ifl+1, "%lx%lx%X%d%d%d%lx",
|
||||||
&d, &g, &flgs, &ref, &use, &metric, &m)!=7) {
|
&d, &g, &flgs, &ref, &use, &metric, &m)!=7) {
|
||||||
error_msg_and_die( "Unsuported kernel route format\n");
|
error_msg_and_die( "Unsuported kernel route format\n");
|
||||||
}
|
}
|
||||||
@ -393,7 +393,10 @@ static void displayroutes(void)
|
|||||||
"Destination Gateway Genmask Flags Metric Ref Use Iface\n");
|
"Destination Gateway Genmask Flags Metric Ref Use Iface\n");
|
||||||
|
|
||||||
ifl = 0; /* parse flags */
|
ifl = 0; /* parse flags */
|
||||||
if(flgs&RTF_UP)
|
if(flgs&RTF_UP) {
|
||||||
|
if(flgs&RTF_REJECT)
|
||||||
|
flags[ifl++]='!';
|
||||||
|
else
|
||||||
flags[ifl++]='U';
|
flags[ifl++]='U';
|
||||||
if(flgs&RTF_GATEWAY)
|
if(flgs&RTF_GATEWAY)
|
||||||
flags[ifl++]='G';
|
flags[ifl++]='G';
|
||||||
@ -404,9 +407,7 @@ static void displayroutes(void)
|
|||||||
if(flgs&RTF_DYNAMIC)
|
if(flgs&RTF_DYNAMIC)
|
||||||
flags[ifl++]='D';
|
flags[ifl++]='D';
|
||||||
if(flgs&RTF_MODIFIED)
|
if(flgs&RTF_MODIFIED)
|
||||||
flags[ifl++]='H';
|
flags[ifl++]='M';
|
||||||
if(flgs&RTF_REJECT)
|
|
||||||
flags[ifl++]='!';
|
|
||||||
flags[ifl]=0;
|
flags[ifl]=0;
|
||||||
dest.s_addr = d;
|
dest.s_addr = d;
|
||||||
gw.s_addr = g;
|
gw.s_addr = g;
|
||||||
@ -420,6 +421,7 @@ static void displayroutes(void)
|
|||||||
inet_ntoa(mask),
|
inet_ntoa(mask),
|
||||||
flags, metric, ref, use, buff);
|
flags, metric, ref, use, buff);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
nl++;
|
nl++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
16
route.c
16
route.c
@ -15,7 +15,7 @@
|
|||||||
* Foundation; either version 2 of the License, or (at
|
* Foundation; either version 2 of the License, or (at
|
||||||
* your option) any later version.
|
* your option) any later version.
|
||||||
*
|
*
|
||||||
* $Id: route.c,v 1.12 2001/08/27 17:57:27 andersen Exp $
|
* $Id: route.c,v 1.13 2001/09/05 19:32:00 andersen Exp $
|
||||||
*
|
*
|
||||||
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
|
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
|
||||||
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
|
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
|
||||||
@ -370,7 +370,7 @@ static void displayroutes(void)
|
|||||||
struct in_addr gw;
|
struct in_addr gw;
|
||||||
struct in_addr mask;
|
struct in_addr mask;
|
||||||
int flgs, ref, use, metric;
|
int flgs, ref, use, metric;
|
||||||
char flags[4];
|
char flags[64];
|
||||||
unsigned long int d,g,m;
|
unsigned long int d,g,m;
|
||||||
|
|
||||||
char sdest[16], sgw[16];
|
char sdest[16], sgw[16];
|
||||||
@ -384,7 +384,7 @@ static void displayroutes(void)
|
|||||||
while(buff[ifl]!=' ' && buff[ifl]!='\t' && buff[ifl]!='\0')
|
while(buff[ifl]!=' ' && buff[ifl]!='\t' && buff[ifl]!='\0')
|
||||||
ifl++;
|
ifl++;
|
||||||
buff[ifl]=0; /* interface */
|
buff[ifl]=0; /* interface */
|
||||||
if(sscanf(buff+ifl+1, "%lx%lx%d%d%d%d%lx",
|
if(sscanf(buff+ifl+1, "%lx%lx%X%d%d%d%lx",
|
||||||
&d, &g, &flgs, &ref, &use, &metric, &m)!=7) {
|
&d, &g, &flgs, &ref, &use, &metric, &m)!=7) {
|
||||||
error_msg_and_die( "Unsuported kernel route format\n");
|
error_msg_and_die( "Unsuported kernel route format\n");
|
||||||
}
|
}
|
||||||
@ -393,7 +393,10 @@ static void displayroutes(void)
|
|||||||
"Destination Gateway Genmask Flags Metric Ref Use Iface\n");
|
"Destination Gateway Genmask Flags Metric Ref Use Iface\n");
|
||||||
|
|
||||||
ifl = 0; /* parse flags */
|
ifl = 0; /* parse flags */
|
||||||
if(flgs&RTF_UP)
|
if(flgs&RTF_UP) {
|
||||||
|
if(flgs&RTF_REJECT)
|
||||||
|
flags[ifl++]='!';
|
||||||
|
else
|
||||||
flags[ifl++]='U';
|
flags[ifl++]='U';
|
||||||
if(flgs&RTF_GATEWAY)
|
if(flgs&RTF_GATEWAY)
|
||||||
flags[ifl++]='G';
|
flags[ifl++]='G';
|
||||||
@ -404,9 +407,7 @@ static void displayroutes(void)
|
|||||||
if(flgs&RTF_DYNAMIC)
|
if(flgs&RTF_DYNAMIC)
|
||||||
flags[ifl++]='D';
|
flags[ifl++]='D';
|
||||||
if(flgs&RTF_MODIFIED)
|
if(flgs&RTF_MODIFIED)
|
||||||
flags[ifl++]='H';
|
flags[ifl++]='M';
|
||||||
if(flgs&RTF_REJECT)
|
|
||||||
flags[ifl++]='!';
|
|
||||||
flags[ifl]=0;
|
flags[ifl]=0;
|
||||||
dest.s_addr = d;
|
dest.s_addr = d;
|
||||||
gw.s_addr = g;
|
gw.s_addr = g;
|
||||||
@ -420,6 +421,7 @@ static void displayroutes(void)
|
|||||||
inet_ntoa(mask),
|
inet_ntoa(mask),
|
||||||
flags, metric, ref, use, buff);
|
flags, metric, ref, use, buff);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
nl++;
|
nl++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user