aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/ip.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1997-12-24 09:29:17 +0000
committerBrian Somers <brian@FreeBSD.org>1997-12-24 09:29:17 +0000
commit70ee81ff6ba03e882c77fba9357f803c13982d31 (patch)
tree1634b1e1f6b1899192dae079bbf6eeccc9d4dbd5 /usr.sbin/ppp/ip.c
parentf9925914f1371e9814b482f32c58a43266f413a9 (diff)
downloadsrc-70ee81ff6ba03e882c77fba9357f803c13982d31.tar.gz
src-70ee81ff6ba03e882c77fba9357f803c13982d31.zip
Cosmetic (style):
sizeof(var) -> sizeof var sizeof type -> sizeof(type) Suggested by: J Wunsch <j@uriah.heep.sax.de>
Notes
Notes: svn path=/head/; revision=31962
Diffstat (limited to 'usr.sbin/ppp/ip.c')
-rw-r--r--usr.sbin/ppp/ip.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index 533798f99437..d3c9e6f03380 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/ppp/ip.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ip.c,v 1.31 1997/11/18 14:52:04 brian Exp $
+ * $Id: ip.c,v 1.32 1997/11/22 03:37:33 brian Exp $
*
* TODO:
* o Return ICMP message for filterd packet
@@ -411,7 +411,7 @@ IpInput(struct mbuf * bp)
IpcpAddInOctets(nb);
nb = ntohs(((struct ip *) tun.data)->ip_len);
- nb += sizeof(tun)-sizeof(tun.data);
+ nb += sizeof tun - sizeof tun.data;
nw = write(tun_out, &tun, nb);
if (nw != nb)
if (nw == -1)
@@ -424,8 +424,9 @@ IpInput(struct mbuf * bp)
while ((fptr = VarPacketAliasGetFragment(tun.data)) != NULL) {
VarPacketAliasFragmentIn(tun.data, fptr);
nb = ntohs(((struct ip *) fptr)->ip_len);
- frag = (struct tun_data *)((char *)fptr-sizeof(tun)+sizeof(tun.data));
- nb += sizeof(tun)-sizeof(tun.data);
+ frag = (struct tun_data *)
+ ((char *)fptr - sizeof tun + sizeof tun.data);
+ nb += sizeof tun - sizeof tun.data;
nw = write(tun_out, frag, nb);
if (nw != nb)
if (nw == -1)
@@ -438,13 +439,13 @@ IpInput(struct mbuf * bp)
}
} else if (iresult == PKT_ALIAS_UNRESOLVED_FRAGMENT) {
nb = ntohs(((struct ip *) tun.data)->ip_len);
- nb += sizeof(tun)-sizeof(tun.data);
+ nb += sizeof tun - sizeof tun.data;
frag = (struct tun_data *)malloc(nb);
if (frag == NULL)
LogPrintf(LogALERT, "IpInput: Cannot allocate memory for fragment\n");
else {
tun_fill_header(*frag, AF_INET);
- memcpy(frag->data, tun.data, nb-sizeof(tun)+sizeof(tun.data));
+ memcpy(frag->data, tun.data, nb - sizeof tun + sizeof tun.data);
VarPacketAliasSaveFragment(frag->data);
}
}
@@ -456,7 +457,7 @@ IpInput(struct mbuf * bp)
return;
}
IpcpAddInOctets(nb);
- nb += sizeof(tun)-sizeof(tun.data);
+ nb += sizeof tun - sizeof tun.data;
nw = write(tun_out, &tun, nb);
if (nw != nb)
if (nw == -1)