diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2009-06-05 00:53:34 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2009-06-05 00:53:34 +0000 |
commit | f7864e423d02d1409e5dfc70f4afb0e2a05a946b (patch) | |
tree | 4058a0f6a18fcdda81259edfd44d5e8ba0075756 | |
parent | b7225d2ed0254ba117756eddcc9fd3ade8740c63 (diff) |
don't mess with buffer internals,
ok claudio@
-rw-r--r-- | usr.sbin/ospfd/packet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/packet.c b/usr.sbin/ospfd/packet.c index fc95f414de0..b0011980614 100644 --- a/usr.sbin/ospfd/packet.c +++ b/usr.sbin/ospfd/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.27 2009/01/31 08:55:00 claudio Exp $ */ +/* $OpenBSD: packet.c,v 1.28 2009/06/05 00:53:33 pyr Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -70,7 +70,7 @@ send_packet(struct iface *iface, struct buf *buf, struct sockaddr_in *dst) ip_hdr.ip_v = IPVERSION; ip_hdr.ip_hl = sizeof(ip_hdr) >> 2; ip_hdr.ip_tos = IPTOS_PREC_INTERNETCONTROL; - ip_hdr.ip_len = htons(buf->wpos + sizeof(ip_hdr)); + ip_hdr.ip_len = htons(buf_size(buf) + sizeof(ip_hdr)); ip_hdr.ip_id = 0; /* 0 means kernel set appropriate value */ ip_hdr.ip_off = 0; ip_hdr.ip_ttl = iface->type != IF_TYPE_VIRTUALLINK ? @@ -85,7 +85,7 @@ send_packet(struct iface *iface, struct buf *buf, struct sockaddr_in *dst) iov[0].iov_base = &ip_hdr; iov[0].iov_len = sizeof(ip_hdr); iov[1].iov_base = buf->buf; - iov[1].iov_len = buf->wpos; + iov[1].iov_len = buf_size(buf); msg.msg_name = dst; msg.msg_namelen = sizeof(*dst); msg.msg_iov = iov; |