mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 09:22:03 +00:00
2004-09-17 Paul Jakma <paul@dishone.st>
* vtysh.c: (vtysh_client_execute) fix the sync fix. The 4th and final sync byte is not ASCII NULL, it's actually a status integer, and only ASCII NULL if CMD_SUCCESS is returned by daemon. Fix pointed out by Hasso.
This commit is contained in:
parent
c8a440eca0
commit
0921d48e8e
@ -1,3 +1,10 @@
|
|||||||
|
2004-09-17 Paul Jakma <paul@dishone.st>
|
||||||
|
|
||||||
|
* vtysh.c: (vtysh_client_execute) fix the sync fix. The 4th and
|
||||||
|
final sync byte is not ASCII NULL, it's actually a status integer,
|
||||||
|
and only ASCII NULL if CMD_SUCCESS is returned by daemon.
|
||||||
|
Fix pointed out by Hasso.
|
||||||
|
|
||||||
2004-10-11 Hasso Tepper <hasso at quagga.net>
|
2004-10-11 Hasso Tepper <hasso at quagga.net>
|
||||||
|
|
||||||
* vtysh.c, vtysh_user.c: Make more strings const.
|
* vtysh.c, vtysh_user.c: Make more strings const.
|
||||||
|
@ -195,7 +195,10 @@ vtysh_client_execute (struct vtysh_client *vclient, const char *line, FILE *fp)
|
|||||||
fprintf (fp, "%s", buf);
|
fprintf (fp, "%s", buf);
|
||||||
fflush (fp);
|
fflush (fp);
|
||||||
|
|
||||||
/* check for trailling \0\0\0\0, even if split across reads */
|
/* check for trailling \0\0\0<ret code>,
|
||||||
|
* even if split across reads
|
||||||
|
* (see lib/vty.c::vtysh_read)
|
||||||
|
*/
|
||||||
if (nbytes >= 4)
|
if (nbytes >= 4)
|
||||||
{
|
{
|
||||||
i = nbytes-4;
|
i = nbytes-4;
|
||||||
@ -204,7 +207,7 @@ vtysh_client_execute (struct vtysh_client *vclient, const char *line, FILE *fp)
|
|||||||
else
|
else
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
while (i < nbytes)
|
while (i < nbytes && numnulls < 3)
|
||||||
{
|
{
|
||||||
if (buf[i++] == '\0')
|
if (buf[i++] == '\0')
|
||||||
numnulls++;
|
numnulls++;
|
||||||
@ -217,10 +220,10 @@ vtysh_client_execute (struct vtysh_client *vclient, const char *line, FILE *fp)
|
|||||||
|
|
||||||
/* got 3 or more trailling nulls? */
|
/* got 3 or more trailling nulls? */
|
||||||
if (numnulls >= 3)
|
if (numnulls >= 3)
|
||||||
return CMD_SUCCESS;
|
return (buf[nbytes-1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
assert (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user