etc/services - sync with NetBSD-8
[minix.git] / minix / lib / liblwip / patches / 0001-MINIX-3-only-mark-various-functions-as-weak.patch
blob6c6922955683d1d5708e2569dd792c6214aa7b96
1 From 2d18d1680a4ea3a0300955675b4e11f596a85a85 Mon Sep 17 00:00:00 2001
2 From: David van Moolenbroek <david@minix3.org>
3 Date: Fri, 27 Jan 2017 00:10:49 +0000
4 Subject: [PATCH 1/4] MINIX 3 only: mark various functions as weak
6 This patch aims to mark the following functions as weak:
8 - ip4_route
9 - ip6_route
10 - ip6_select_source_address
12 This allows the LWIP service to override the implementation of those
13 functions entirely, without requiring the definition of new prototypes
14 for example. Overriding all of these functions is essential for the
15 correct operation of the LWIP service, mainly to support more advanced
16 features correctly despite missing support for them in lwIP.
18 If this patch can no longer be applied, or compilation breaks after
19 applying this patch--for example, because the service can no longer
20 find these functions' prototypes or the prototypes are incorrect--then
21 both this patch and the LWIP service will have to be altered in order
22 to achieve the same goal of overriding the above three functions.
23 ---
24 src/core/ipv4/ip4.c | 1 +
25 src/core/ipv6/ip6.c | 2 ++
26 2 files changed, 3 insertions(+)
28 diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c
29 index 2335452..d2b1751 100644
30 --- a/src/core/ipv4/ip4.c
31 +++ b/src/core/ipv4/ip4.c
32 @@ -149,6 +149,7 @@ ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src)
33 * @return the netif on which to send to reach dest
35 struct netif *
36 +__weak
37 ip4_route(const ip4_addr_t *dest)
39 #if !LWIP_SINGLE_NETIF
40 diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c
41 index 39e282e..88d998b 100644
42 --- a/src/core/ipv6/ip6.c
43 +++ b/src/core/ipv6/ip6.c
44 @@ -83,6 +83,7 @@
45 * @return the netif on which to send to reach dest
47 struct netif *
48 +__weak
49 ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest)
51 #if LWIP_SINGLE_NETIF
52 @@ -278,6 +279,7 @@ ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest)
53 * source address is found
55 const ip_addr_t *
56 +__weak
57 ip6_select_source_address(struct netif *netif, const ip6_addr_t *dest)
59 const ip_addr_t *best_addr;
60 --
61 2.5.2