diff options
author | 1998-02-22 01:21:31 +0000 | |
---|---|---|
committer | 1998-02-22 01:21:31 +0000 | |
commit | 6de36799d602a12acb88e06fc49a5eaa728c6d21 (patch) | |
tree | 9d18a7e2266b4cd3dad5e79abe32173305b43659 | |
parent | Save possible OLF OS tag, or similar deduced ELF info for later perusal. (diff) | |
download | wireguard-openbsd-6de36799d602a12acb88e06fc49a5eaa728c6d21.tar.xz wireguard-openbsd-6de36799d602a12acb88e06fc49a5eaa728c6d21.zip |
Changes made for GCC 2.8 -Wall pleasures
-rw-r--r-- | sys/net/encap.c | 9 | ||||
-rw-r--r-- | sys/net/route.h | 7 | ||||
-rw-r--r-- | sys/netinet/ip_ah_new.c | 14 | ||||
-rw-r--r-- | sys/netinet/ip_ah_old.c | 14 | ||||
-rw-r--r-- | sys/netinet/ip_esp_new.c | 14 | ||||
-rw-r--r-- | sys/netinet/ip_esp_old.c | 16 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.c | 8 | ||||
-rw-r--r-- | sys/nfs/nfs_serv.c | 32 | ||||
-rw-r--r-- | sys/nfs/nfs_var.h | 3 |
9 files changed, 69 insertions, 48 deletions
diff --git a/sys/net/encap.c b/sys/net/encap.c index 48267fb46e7..6aba6ad6dd6 100644 --- a/sys/net/encap.c +++ b/sys/net/encap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: encap.c,v 1.19 1997/11/15 00:07:06 deraadt Exp $ */ +/* $OpenBSD: encap.c,v 1.20 1998/02/22 01:23:29 niklas Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -481,11 +481,12 @@ va_dcl emp->em_ena_protocol, emp->em_ena_sport, emp->em_ena_dport); if (flow4 != (struct flow *) NULL) + { if (!(emp->em_ena_flags & ENABLE_FLAG_REPLACE)) SENDERR(EEXIST); - else - if (flow3 == flow4) - SENDERR(EINVAL); + else if (flow3 == flow4) + SENDERR(EINVAL); + } } flow = get_flow(); diff --git a/sys/net/route.h b/sys/net/route.h index 19fb96c1199..fa0b3edfd97 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -1,4 +1,4 @@ -/* $OpenBSD: route.h,v 1.2 1996/03/03 21:07:20 niklas Exp $ */ +/* $OpenBSD: route.h,v 1.3 1998/02/22 01:23:29 niklas Exp $ */ /* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */ /* @@ -228,11 +228,12 @@ struct route_cb { }; #ifdef _KERNEL -#define RTFREE(rt) \ +#define RTFREE(rt) do { \ if ((rt)->rt_refcnt <= 1) \ rtfree(rt); \ else \ - (rt)->rt_refcnt--; + (rt)->rt_refcnt--; \ +} while (0) struct route_cb route_cb; struct rtstat rtstat; diff --git a/sys/netinet/ip_ah_new.c b/sys/netinet/ip_ah_new.c index 4721cb5fc4b..9c48aa271e2 100644 --- a/sys/netinet/ip_ah_new.c +++ b/sys/netinet/ip_ah_new.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah_new.c,v 1.15 1998/01/21 18:43:32 provos Exp $ */ +/* $OpenBSD: ip_ah_new.c,v 1.16 1998/02/22 01:23:30 niklas Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -511,6 +511,7 @@ ah_new_input(struct mbuf *m, struct tdb *tdb) /* Notify on expiration */ if (tdb->tdb_flags & TDBF_SOFT_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_soft_packets) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -523,8 +524,10 @@ ah_new_input(struct mbuf *m, struct tdb *tdb) encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_BYTES; } - + } + if (tdb->tdb_flags & TDBF_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_exp_packets) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -537,6 +540,7 @@ ah_new_input(struct mbuf *m, struct tdb *tdb) encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } + } return m; } @@ -759,6 +763,7 @@ ah_new_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, /* Notify on expiration */ if (tdb->tdb_flags & TDBF_SOFT_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_soft_packets) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -771,8 +776,10 @@ ah_new_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_BYTES; } - + } + if (tdb->tdb_flags & TDBF_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_exp_packets) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -785,6 +792,7 @@ ah_new_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } + } return 0; } diff --git a/sys/netinet/ip_ah_old.c b/sys/netinet/ip_ah_old.c index 2998d4ba569..60bcb851ba2 100644 --- a/sys/netinet/ip_ah_old.c +++ b/sys/netinet/ip_ah_old.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah_old.c,v 1.11 1998/01/21 18:43:33 provos Exp $ */ +/* $OpenBSD: ip_ah_old.c,v 1.12 1998/02/22 01:23:31 niklas Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -411,6 +411,7 @@ ah_old_input(struct mbuf *m, struct tdb *tdb) /* Notify on expiration */ if (tdb->tdb_flags & TDBF_SOFT_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_soft_packets) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -423,8 +424,10 @@ ah_old_input(struct mbuf *m, struct tdb *tdb) encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_BYTES; } - + } + if (tdb->tdb_flags & TDBF_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_exp_packets) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -437,6 +440,7 @@ ah_old_input(struct mbuf *m, struct tdb *tdb) encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } + } return m; } @@ -638,6 +642,7 @@ ah_old_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, /* Notify on expiration */ if (tdb->tdb_flags & TDBF_SOFT_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_soft_packets) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -650,8 +655,10 @@ ah_old_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_BYTES; } - + } + if (tdb->tdb_flags & TDBF_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_exp_packets) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -664,6 +671,7 @@ ah_old_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } + } return 0; } diff --git a/sys/netinet/ip_esp_new.c b/sys/netinet/ip_esp_new.c index a7a95de07e9..2260fbabed9 100644 --- a/sys/netinet/ip_esp_new.c +++ b/sys/netinet/ip_esp_new.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp_new.c,v 1.15 1998/01/21 18:43:33 provos Exp $ */ +/* $OpenBSD: ip_esp_new.c,v 1.16 1998/02/22 01:23:32 niklas Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -808,6 +808,7 @@ esp_new_input(struct mbuf *m, struct tdb *tdb) /* Notify on expiration */ if (tdb->tdb_flags & TDBF_SOFT_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_soft_packets) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -820,8 +821,10 @@ esp_new_input(struct mbuf *m, struct tdb *tdb) encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_BYTES; } - + } + if (tdb->tdb_flags & TDBF_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_exp_packets) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -834,6 +837,7 @@ esp_new_input(struct mbuf *m, struct tdb *tdb) encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } + } return m; } @@ -1097,6 +1101,7 @@ esp_new_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, /* Notify on expiration */ if (tdb->tdb_flags & TDBF_SOFT_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_soft_packets) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -1109,8 +1114,10 @@ esp_new_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_BYTES; } - + } + if (tdb->tdb_flags & TDBF_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_exp_packets) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -1123,6 +1130,7 @@ esp_new_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } + } return 0; } diff --git a/sys/netinet/ip_esp_old.c b/sys/netinet/ip_esp_old.c index 7c4466bb09a..4a131b284f8 100644 --- a/sys/netinet/ip_esp_old.c +++ b/sys/netinet/ip_esp_old.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp_old.c,v 1.13 1998/02/03 19:06:29 deraadt Exp $ */ +/* $OpenBSD: ip_esp_old.c,v 1.14 1998/02/22 01:23:32 niklas Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -501,6 +501,7 @@ esp_old_input(struct mbuf *m, struct tdb *tdb) /* Notify on expiration */ if (tdb->tdb_flags & TDBF_SOFT_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_soft_packets) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -513,8 +514,10 @@ esp_old_input(struct mbuf *m, struct tdb *tdb) encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_BYTES; } - + } + if (tdb->tdb_flags & TDBF_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_exp_packets) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -527,7 +530,8 @@ esp_old_input(struct mbuf *m, struct tdb *tdb) encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } - + } + return m; } @@ -750,6 +754,7 @@ esp_old_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, /* Notify on expiration */ if (tdb->tdb_flags & TDBF_SOFT_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_soft_packets) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -762,8 +767,10 @@ esp_old_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_BYTES; } - + } + if (tdb->tdb_flags & TDBF_PACKETS) + { if (tdb->tdb_cur_packets >= tdb->tdb_exp_packets) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -776,6 +783,7 @@ esp_old_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } + } return 0; } diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index d7aec220783..cf3dd121b6b 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ip_ipsp.c,v 1.23 1997/11/04 09:11:15 provos Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.24 1998/02/22 01:23:33 niklas Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, @@ -264,6 +264,7 @@ handle_expirations(void *arg) /* Soft expirations */ if (tdb->tdb_flags & TDBF_SOFT_TIMER) + { if (tdb->tdb_soft_timeout <= time.tv_sec) { encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); @@ -277,9 +278,11 @@ handle_expirations(void *arg) encap_sendnotify(NOTIFY_SOFT_EXPIRE, tdb); tdb->tdb_flags &= ~TDBF_SOFT_FIRSTUSE; } - + } + /* Hard expirations */ if (tdb->tdb_flags & TDBF_TIMER) + { if (tdb->tdb_exp_timeout <= time.tv_sec) { encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); @@ -293,6 +296,7 @@ handle_expirations(void *arg) encap_sendnotify(NOTIFY_HARD_EXPIRE, tdb); tdb_delete(tdb, 0); } + } free(exp, M_TDB); } diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index e4ecb5b3fac..31beaa583cd 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_serv.c,v 1.14 1997/11/06 05:59:02 csapuntz Exp $ */ +/* $OpenBSD: nfs_serv.c,v 1.15 1998/02/22 01:21:31 niklas Exp $ */ /* $NetBSD: nfs_serv.c,v 1.25 1996/03/02 15:55:52 jtk Exp $ */ /* @@ -1777,45 +1777,27 @@ nfsrv_rename(nfsd, slp, procp, mrq) tvp = tond.ni_vp; if (tvp != NULL) { if (fvp->v_type == VDIR && tvp->v_type != VDIR) { - if (v3) - error = EEXIST; - else - error = EISDIR; + error = v3 ? EEXIST : EISDIR; goto out; } else if (fvp->v_type != VDIR && tvp->v_type == VDIR) { - if (v3) - error = EEXIST; - else - error = ENOTDIR; + error = v3 ? EEXIST : ENOTDIR; goto out; } if (tvp->v_type == VDIR && tvp->v_mountedhere) { - if (v3) - error = EXDEV; - else - error = ENOTEMPTY; + error = v3 ? EXDEV : ENOTEMPTY; goto out; } } if (fvp->v_type == VDIR && fvp->v_mountedhere) { - if (v3) - error = EXDEV; - else - error = ENOTEMPTY; + error = v3 ? EXDEV : ENOTEMPTY; goto out; } if (fvp->v_mount != tdvp->v_mount) { - if (v3) - error = EXDEV; - else - error = ENOTEMPTY; + error = v3 ? EXDEV : ENOTEMPTY; goto out; } if (fvp == tdvp) - if (v3) - error = EINVAL; - else - error = ENOTEMPTY; + error = v3 ? EINVAL : ENOTEMPTY; /* * If source is the same as the destination (that is the * same vnode with the same name in the same directory), diff --git a/sys/nfs/nfs_var.h b/sys/nfs/nfs_var.h index d90a58e6a88..2b1980c14a5 100644 --- a/sys/nfs/nfs_var.h +++ b/sys/nfs/nfs_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_var.h,v 1.7 1997/11/06 05:59:04 csapuntz Exp $ */ +/* $OpenBSD: nfs_var.h,v 1.8 1998/02/22 01:21:32 niklas Exp $ */ /* $NetBSD: nfs_var.h,v 1.3 1996/02/18 11:53:54 fvdl Exp $ */ /* @@ -60,6 +60,7 @@ struct componentname; struct nfsd_srvargs; struct nfsrv_descript; struct nfs_fattr; +union nethostaddr; /* nfs_bio.c */ int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *)); |