summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2019-02-17 15:21:32 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2019-02-17 15:21:32 +0000
commitae0cff4ce7f2e4c151d1b6b4712068b9bbfea54e (patch)
tree08e8b7516d57bad0ce8befe42814100c3781abc5 /sys
parent68e6be85dd75e11d88bed38b4a98ffd16b7b287c (diff)
Make bridge_rtupdate() return an error value instead of a pointer.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/bridgectl.c15
-rw-r--r--sys/net/if_bridge.h4
2 files changed, 9 insertions, 10 deletions
diff --git a/sys/net/bridgectl.c b/sys/net/bridgectl.c
index 4f27669fd92..ca2d1986659 100644
--- a/sys/net/bridgectl.c
+++ b/sys/net/bridgectl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bridgectl.c,v 1.14 2019/02/14 18:19:13 mpi Exp $ */
+/* $OpenBSD: bridgectl.c,v 1.15 2019/02/17 15:21:31 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -90,9 +90,8 @@ bridgectl_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
}
- ifs = bridge_rtupdate(sc, &bareq->ifba_dst, ifs, 1,
- bareq->ifba_flags, NULL);
- if (ifs == NULL)
+ if (bridge_rtupdate(sc, &bareq->ifba_dst, ifs, 1,
+ bareq->ifba_flags, NULL))
error = ENOMEM;
break;
case SIOCBRDGDADDR:
@@ -180,14 +179,14 @@ bridgectl_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (error);
}
-struct ifnet *
+int
bridge_rtupdate(struct bridge_softc *sc, struct ether_addr *ea,
struct ifnet *ifp, int setflags, u_int8_t flags, struct mbuf *m)
{
struct bridge_rtnode *p, *q;
struct bridge_tunneltag *brtag = NULL;
u_int32_t h;
- int dir;
+ int dir, error = 0;
if (m != NULL) {
/* Check if the mbuf was tagged with a tunnel endpoint addr */
@@ -283,9 +282,9 @@ bridge_rtupdate(struct bridge_softc *sc, struct ether_addr *ea,
} while (p != NULL);
done:
- ifp = NULL;
+ error = 1;
want:
- return (ifp);
+ return (error);
}
struct bridge_rtnode *
diff --git a/sys/net/if_bridge.h b/sys/net/if_bridge.h
index e51ae587f3f..fee3aeac954 100644
--- a/sys/net/if_bridge.h
+++ b/sys/net/if_bridge.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.h,v 1.60 2019/01/29 17:47:35 mpi Exp $ */
+/* $OpenBSD: if_bridge.h,v 1.61 2019/02/17 15:21:31 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -507,7 +507,7 @@ u_int8_t bstp_getstate(struct bstp_state *, struct bstp_port *);
void bstp_ifsflags(struct bstp_port *, u_int);
int bridgectl_ioctl(struct ifnet *, u_long, caddr_t);
-struct ifnet *bridge_rtupdate(struct bridge_softc *,
+int bridge_rtupdate(struct bridge_softc *,
struct ether_addr *, struct ifnet *ifp, int, u_int8_t, struct mbuf *);
struct bridge_rtnode *bridge_rtlookup(struct bridge_softc *,
struct ether_addr *);