diff options
author | 2015-09-14 11:01:47 +0000 | |
---|---|---|
committer | 2015-09-14 11:01:47 +0000 | |
commit | 92a2407899c4cffab8cb1d175a10b79dc3e36246 (patch) | |
tree | ee8c1c00ce7162fd135324aaf7a43c4cebde0fee /lib | |
parent | Wrap <net/if.h> and <net/if_dl.h> so internal calls go direct and all the (diff) | |
download | wireguard-openbsd-92a2407899c4cffab8cb1d175a10b79dc3e36246.tar.xz wireguard-openbsd-92a2407899c4cffab8cb1d175a10b79dc3e36246.zip |
Wrap <ifaddrs.h>, <netinet/in.h>, and <netinet/if_ether.h> so internal
calls go direct and all the symbols are weak
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/hidden/ifaddrs.h | 26 | ||||
-rw-r--r-- | lib/libc/hidden/netinet/if_ether.h | 29 | ||||
-rw-r--r-- | lib/libc/hidden/netinet/in.h | 46 | ||||
-rw-r--r-- | lib/libc/net/ethers.c | 3 | ||||
-rw-r--r-- | lib/libc/net/getifaddrs.c | 4 | ||||
-rw-r--r-- | lib/libc/net/rthdr.c | 3 | ||||
-rw-r--r-- | lib/libc/rpc/bindresvport.c | 4 |
7 files changed, 111 insertions, 4 deletions
diff --git a/lib/libc/hidden/ifaddrs.h b/lib/libc/hidden/ifaddrs.h new file mode 100644 index 00000000000..c3ccd037339 --- /dev/null +++ b/lib/libc/hidden/ifaddrs.h @@ -0,0 +1,26 @@ +/* $OpenBSD: ifaddrs.h,v 1.1 2015/09/14 11:01:47 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_IFADDRS_H_ +#define _LIBC_IFADDRS_H_ + +#include_next <ifaddrs.h> + +PROTO_NORMAL(getifaddrs); +PROTO_NORMAL(freeifaddrs); + +#endif /* _LIBC_IFADDRS_H_ */ diff --git a/lib/libc/hidden/netinet/if_ether.h b/lib/libc/hidden/netinet/if_ether.h new file mode 100644 index 00000000000..78910656ea8 --- /dev/null +++ b/lib/libc/hidden/netinet/if_ether.h @@ -0,0 +1,29 @@ +/* $OpenBSD: if_ether.h,v 1.1 2015/09/14 11:01:47 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_NETINET_IF_ETHER_H_ +#define _LIBC_NETINET_IF_ETHER_H_ + +#include_next <netinet/if_ether.h> + +PROTO_DEPRECATED(ether_aton); +PROTO_DEPRECATED(ether_hostton); +PROTO_NORMAL(ether_line); +PROTO_DEPRECATED(ether_ntoa); +PROTO_DEPRECATED(ether_ntohost); + +#endif /* _LIBC_NETINET_IF_ETHER_H_ */ diff --git a/lib/libc/hidden/netinet/in.h b/lib/libc/hidden/netinet/in.h new file mode 100644 index 00000000000..1c4bcd15db5 --- /dev/null +++ b/lib/libc/hidden/netinet/in.h @@ -0,0 +1,46 @@ +/* $OpenBSD: in.h,v 1.1 2015/09/14 11:01:47 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_NETINET_IN_H_ +#define _LIBC_NETINET_IN_H_ + +#include_next <netinet/in.h> + +extern PROTO_DEPRECATED(in6addr_any); +extern PROTO_DEPRECATED(in6addr_loopback); +extern PROTO_DEPRECATED(in6addr_intfacelocal_allnodes); +extern PROTO_DEPRECATED(in6addr_linklocal_allnodes); +extern PROTO_DEPRECATED(in6addr_linklocal_allrouters); + +PROTO_NORMAL(bindresvport); +PROTO_NORMAL(bindresvport_sa); +PROTO_DEPRECATED(inet6_opt_append); +PROTO_DEPRECATED(inet6_opt_find); +PROTO_DEPRECATED(inet6_opt_finish); +PROTO_DEPRECATED(inet6_opt_get_val); +PROTO_DEPRECATED(inet6_opt_init); +PROTO_DEPRECATED(inet6_opt_next); +PROTO_DEPRECATED(inet6_opt_set_val); +PROTO_DEPRECATED(inet6_rth_add); +PROTO_DEPRECATED(inet6_rth_getaddr); +PROTO_DEPRECATED(inet6_rth_init); +PROTO_DEPRECATED(inet6_rth_reverse); +PROTO_DEPRECATED(inet6_rth_segments); +PROTO_NORMAL(inet6_rth_space); + +#endif /* _LIBC_NETINET_IN_H_ */ + diff --git a/lib/libc/net/ethers.c b/lib/libc/net/ethers.c index a89f0c217bf..a7e0796c72f 100644 --- a/lib/libc/net/ethers.c +++ b/lib/libc/net/ethers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ethers.c,v 1.23 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: ethers.c,v 1.24 2015/09/14 11:01:47 guenther Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> @@ -232,3 +232,4 @@ bad: errno = EINVAL; return (-1); } +DEF_WEAK(ether_line); diff --git a/lib/libc/net/getifaddrs.c b/lib/libc/net/getifaddrs.c index 51dbbab8717..182829c9d5e 100644 --- a/lib/libc/net/getifaddrs.c +++ b/lib/libc/net/getifaddrs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getifaddrs.c,v 1.12 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: getifaddrs.c,v 1.13 2015/09/14 11:01:47 guenther Exp $ */ /* * Copyright (c) 1995, 1999 @@ -288,9 +288,11 @@ getifaddrs(struct ifaddrs **pif) } return (0); } +DEF_WEAK(getifaddrs); void freeifaddrs(struct ifaddrs *ifp) { free(ifp); } +DEF_WEAK(freeifaddrs); diff --git a/lib/libc/net/rthdr.c b/lib/libc/net/rthdr.c index 92a1f75a769..1a29e87de14 100644 --- a/lib/libc/net/rthdr.c +++ b/lib/libc/net/rthdr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthdr.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: rthdr.c,v 1.11 2015/09/14 11:01:47 guenther Exp $ */ /* $KAME: rthdr.c,v 1.22 2006/02/09 08:18:58 keiichi Exp $ */ /* @@ -53,6 +53,7 @@ inet6_rth_space(int type, int segments) return (0); /* type not suppported */ } } +DEF_WEAK(inet6_rth_space); void * inet6_rth_init(void *bp, socklen_t bp_len, int type, int segments) diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c index 10ee787868c..145a7de9944 100644 --- a/lib/libc/rpc/bindresvport.c +++ b/lib/libc/rpc/bindresvport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bindresvport.c,v 1.17 2005/12/21 01:40:22 millert Exp $ */ +/* $OpenBSD: bindresvport.c,v 1.18 2015/09/14 11:01:47 guenther Exp $ */ /* * Copyright 1996, Jason Downs. All rights reserved. @@ -39,6 +39,7 @@ bindresvport(int sd, struct sockaddr_in *sin) { return bindresvport_sa(sd, (struct sockaddr *)sin); } +DEF_WEAK(bindresvport); /* * Bind a socket to a privileged port for whatever protocol. @@ -121,3 +122,4 @@ bindresvport_sa(int sd, struct sockaddr *sa) } return (error); } +DEF_WEAK(bindresvport_sa); |