summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/ip.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-11-07 22:05:29 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-11-07 22:05:29 +0100
commit857f2528e0b014b6bd839535daaa6b53853703d9 (patch)
treec81c520a5cf17c79ea31acbf018f36acbc130489 /sys/src/9/ip/ip.c
parentea993877a96cd535199d0cd437e49f8d616615d9 (diff)
ip: always pass a single block to Medium.bwrite(), avoid concatblock() calls in Dev.bwrite()
the convention for Dev.bwrite() is that it accepts a *single* block, and not a block chain. so we never have concatblock here. to keep stuff consistent, we also guarantee thet Medium.bwrite() will get a *single* block passed as well, as the callers are few in number.
Diffstat (limited to 'sys/src/9/ip/ip.c')
-rw-r--r--sys/src/9/ip/ip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/9/ip/ip.c b/sys/src/9/ip/ip.c
index 0a8863e77..ef8a7e19c 100644
--- a/sys/src/9/ip/ip.c
+++ b/sys/src/9/ip/ip.c
@@ -208,7 +208,7 @@ ipoput4(Fs *f, Block *bp, int gating, int ttl, int tos, Conv *c)
eh->cksum[0] = 0;
eh->cksum[1] = 0;
hnputs(eh->cksum, ipcsum(&eh->vihl));
- ifc->m->bwrite(ifc, bp, V4, gate);
+ ifc->m->bwrite(ifc, concatblock(bp), V4, gate);
runlock(ifc);
poperror();
return 0;
@@ -240,7 +240,7 @@ if((eh->frag[0] & (IP_DF>>8)) && !gating) print("%V: DF set\n", eh->dst);
lid = incref(&ip->id4);
offset = IP4HDR;
- while(xp != nil && offset && offset >= BLEN(xp)) {
+ while(offset && offset >= BLEN(xp)) {
offset -= BLEN(xp);
xp = xp->next;
}