summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorpaul <paul>2005-02-09 15:51:56 +0000
committerpaul <paul>2005-02-09 15:51:56 +0000
commit9985f83ce7102f64b15f744b60320f8d14a8a5ff (patch)
tree344629bdc2b4a7d53b8d7ca1705c9be2ca282d18 /zebra
parent083ee9d9cdbf72a452b9af96e62d0625ea712cd9 (diff)
2005-02-09 Paul Jakma <paul.jakma@sun.com>
* (global) Update code to match stream.h changes. stream_get_putp effectively replaced with stream_get_endp. stream_forward renamed to stream_forward_getp. stream_forward_endp introduced to replace some previous setting/manual twiddling of putp by daemons. * lib/stream.h: Remove putp. Update reference to putp with endp. Add stream_forward_endp, which daemons were doing manually. Rename stream_forward to stream_forward_getp. lib/stream.c: Remove/update references to putp. introduce stream_forward_endp.
Diffstat (limited to 'zebra')
-rw-r--r--zebra/irdp_packet.c6
-rw-r--r--zebra/zserv.c16
2 files changed, 11 insertions, 11 deletions
diff --git a/zebra/irdp_packet.c b/zebra/irdp_packet.c
index 77e559cc..2f448eca 100644
--- a/zebra/irdp_packet.c
+++ b/zebra/irdp_packet.c
@@ -305,11 +305,11 @@ send_packet(struct interface *ifp,
icmp = (struct icmphdr *) (buf + sizeof (struct ip));
/* Merge IP header with icmp packet */
-
- stream_get(icmp, s, s->putp);
+ assert (stream_get_endp(s) < (sizeof (buf) - sizeof (struct ip)));
+ stream_get(icmp, s, stream_get_endp(s));
/* icmp->checksum is already calculated */
- ip->ip_len = sizeof(struct ip) + s->putp;
+ ip->ip_len = sizeof(struct ip) + stream_get_endp(s);
stream_free(s);
on = 1;
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 10616b41..dfaa90e7 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -480,7 +480,7 @@ zsend_route_multipath (int cmd, struct zserv *client, struct prefix *p,
{
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
{
- nhnummark = stream_get_putp (s);
+ nhnummark = stream_get_endp (s);
stream_putc (s, 1); /* placeholder */
nhnum++;
@@ -562,7 +562,7 @@ zsend_ipv6_nexthop_lookup (struct zserv *client, struct in6_addr *addr)
{
stream_putl (s, rib->metric);
num = 0;
- nump = s->putp;
+ nump = stream_get_endp(s);
stream_putc (s, 0);
for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
@@ -629,7 +629,7 @@ zsend_ipv4_nexthop_lookup (struct zserv *client, struct in_addr addr)
{
stream_putl (s, rib->metric);
num = 0;
- nump = s->putp;
+ nump = stream_get_endp(s);
stream_putc (s, 0);
for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
@@ -690,7 +690,7 @@ zsend_ipv4_import_lookup (struct zserv *client, struct prefix_ipv4 *p)
{
stream_putl (s, rib->metric);
num = 0;
- nump = s->putp;
+ nump = stream_get_endp(s);
stream_putc (s, 0);
for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
@@ -853,14 +853,14 @@ zread_ipv4_add (struct zserv *client, u_short length)
break;
case ZEBRA_NEXTHOP_IFNAME:
ifname_len = stream_getc (s);
- stream_forward (s, ifname_len);
+ stream_forward_getp (s, ifname_len);
break;
case ZEBRA_NEXTHOP_IPV4:
nexthop.s_addr = stream_get_ipv4 (s);
nexthop_ipv4_add (rib, &nexthop);
break;
case ZEBRA_NEXTHOP_IPV6:
- stream_forward (s, IPV6_MAX_BYTELEN);
+ stream_forward_getp (s, IPV6_MAX_BYTELEN);
break;
case ZEBRA_NEXTHOP_BLACKHOLE:
nexthop_blackhole_add (rib);
@@ -925,13 +925,13 @@ zread_ipv4_delete (struct zserv *client, u_short length)
break;
case ZEBRA_NEXTHOP_IFNAME:
ifname_len = stream_getc (s);
- stream_forward (s, ifname_len);
+ stream_forward_getp (s, ifname_len);
break;
case ZEBRA_NEXTHOP_IPV4:
nexthop.s_addr = stream_get_ipv4 (s);
break;
case ZEBRA_NEXTHOP_IPV6:
- stream_forward (s, IPV6_MAX_BYTELEN);
+ stream_forward_getp (s, IPV6_MAX_BYTELEN);
break;
}
}