summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ip.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-12-24 09:29:17 +0000
committerbrian <brian@FreeBSD.org>1997-12-24 09:29:17 +0000
commit14d342e696e1f58935e230c2b5bda26daa36cda0 (patch)
tree73e0e9a6ac1b2542326d644b2e9f7611a6f6a810 /usr.sbin/ppp/ip.c
parente2cdbfbbb2fff725814c29bd10d948ba15f8240e (diff)
downloadFreeBSD-src-14d342e696e1f58935e230c2b5bda26daa36cda0.zip
FreeBSD-src-14d342e696e1f58935e230c2b5bda26daa36cda0.tar.gz
Cosmetic (style):
sizeof(var) -> sizeof var sizeof type -> sizeof(type) Suggested by: J Wunsch <j@uriah.heep.sax.de>
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 533798f..d3c9e6f 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)
OpenPOWER on IntegriCloud