summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2002-10-07 14:53:01 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2002-10-07 14:53:01 +0000
commitedf761d3f00056830ab819d91f69bfdb1a2ce651 (patch)
treefe22bcc895d44bf0d6f3da96ff977d1eab816360 /sys/net
parentcb09e412187e89b5cd7cf41aedf8181f5891c3a6 (diff)
-Wsign-compare clean
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pf.c15
-rw-r--r--sys/net/pf_ioctl.c8
-rw-r--r--sys/net/pf_norm.c8
3 files changed, 16 insertions, 15 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 88115ae17ce..714ae67d97d 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.252 2002/10/07 13:23:45 henning Exp $ */
+/* $OpenBSD: pf.c,v 1.253 2002/10/07 14:53:00 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -630,7 +630,7 @@ pf_purge_expired_states(void)
for (cur = RB_MIN(pf_state_tree, &tree_ext_gwy); cur; cur = next) {
next = RB_NEXT(pf_state_tree, &tree_ext_gwy, cur);
- if (cur->state->expire <= time.tv_sec) {
+ if (cur->state->expire <= (unsigned)time.tv_sec) {
RB_REMOVE(pf_state_tree, &tree_ext_gwy, cur);
/* Need this key's peer (in the other tree) */
@@ -3587,7 +3587,8 @@ pf_pull_hdr(struct mbuf *m, int off, void *p, int len,
case AF_INET6: {
struct ip6_hdr *h = mtod(m, struct ip6_hdr *);
if (m->m_pkthdr.len < off + len ||
- (ntohs(h->ip6_plen) + sizeof(struct ip6_hdr)) < off + len) {
+ (ntohs(h->ip6_plen) + sizeof(struct ip6_hdr)) <
+ (unsigned)(off + len)) {
ACTION_SET(actionp, PF_DROP);
REASON_SET(reasonp, PFRES_SHORT);
return (NULL);
@@ -3833,7 +3834,7 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp)
* If the packet is too large for the outgoing interface,
* send back an icmp6 error.
*/
- if (m0->m_pkthdr.len <= ifp->if_mtu) {
+ if ((u_long)m0->m_pkthdr.len <= ifp->if_mtu) {
error = (*ifp->if_output)(ifp, m0, (struct sockaddr *)dst,
NULL);
} else {
@@ -3876,7 +3877,7 @@ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0)
panic("non-M_PKTHDR is passed to pf_test");
#endif
- if (m->m_pkthdr.len < sizeof(*h)) {
+ if (m->m_pkthdr.len < (int)sizeof(*h)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_SHORT);
log = 1;
@@ -3892,7 +3893,7 @@ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0)
h = mtod(m, struct ip *);
off = h->ip_hl << 2;
- if (off < sizeof(*h)) {
+ if (off < (int)sizeof(*h)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_SHORT);
log = 1;
@@ -4042,7 +4043,7 @@ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0)
panic("non-M_PKTHDR is passed to pf_test");
#endif
- if (m->m_pkthdr.len < sizeof(*h)) {
+ if (m->m_pkthdr.len < (int)sizeof(*h)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_SHORT);
log = 1;
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 4708ce3dbdb..0781c88554d 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.8 2002/08/12 16:41:25 dhartmei Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.9 2002/10/07 14:53:00 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1260,7 +1260,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
splx(s);
secs = time.tv_sec;
ps->state.creation = secs - ps->state.creation;
- if (ps->state.expire <= secs)
+ if (ps->state.expire <= (unsigned)secs)
ps->state.expire = 0;
else
ps->state.expire -= secs;
@@ -1288,7 +1288,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
RB_FOREACH(n, pf_state_tree, &tree_ext_gwy) {
int secs = time.tv_sec;
- if ((nr + 1) * sizeof(*p) > ps->ps_len)
+ if ((nr + 1) * sizeof(*p) > (unsigned)ps->ps_len)
break;
bcopy(n->state, &pstore, sizeof(pstore));
@@ -1297,7 +1297,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
else
pstore.rule.nr = n->state->rule.ptr->nr;
pstore.creation = secs - pstore.creation;
- if (pstore.expire <= secs)
+ if (pstore.expire <= (unsigned)secs)
pstore.expire = 0;
else
pstore.expire -= secs;
diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c
index 4024b763867..ebfac1e3945 100644
--- a/sys/net/pf_norm.c
+++ b/sys/net/pf_norm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_norm.c,v 1.35 2002/06/28 00:08:23 deraadt Exp $ */
+/* $OpenBSD: pf_norm.c,v 1.36 2002/10/07 14:53:00 dhartmei Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@@ -633,7 +633,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment *frag, int mff,
h = mtod(m, struct ip *);
- KASSERT(m->m_len == h->ip_len - precut);
+ KASSERT((int)m->m_len == h->ip_len - precut);
h->ip_off += precut >> 3;
h->ip_len -= precut;
@@ -689,7 +689,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment *frag, int mff,
m->m_pkthdr.len = plen;
}
h = mtod(m, struct ip *);
- KASSERT(m->m_len == h->ip_len - aftercut);
+ KASSERT((int)m->m_len == h->ip_len - aftercut);
h->ip_len -= aftercut;
} else {
hosed++;
@@ -841,7 +841,7 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct ifnet *ifp, u_short *reason)
return (PF_PASS);
/* Check for illegal packets */
- if (hlen < sizeof(struct ip))
+ if (hlen < (int)sizeof(struct ip))
goto drop;
if (hlen > h->ip_len)