X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/55414b25bee9f0195ccd1e47f3d3b5cba766e099..1d28cc061677bd07d9bed48dd84bd5c590247043:/src/src/routers/ipliteral.c diff --git a/src/src/routers/ipliteral.c b/src/src/routers/ipliteral.c index e9c18658b..1297b97f2 100644 --- a/src/src/routers/ipliteral.c +++ b/src/src/routers/ipliteral.c @@ -2,8 +2,10 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2009 */ +/* Copyright (c) The Exim Maintainers 2020 - 2022 */ +/* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include "../exim.h" @@ -15,7 +17,7 @@ empty declarations ("undefined" in the Standard) we put in a dummy value. */ optionlist ipliteral_router_options[] = { - { "", opt_hidden, NULL } + { "", opt_hidden, {NULL} } }; /* Size of the options list. An extern variable has to be used so that its @@ -30,6 +32,17 @@ value is present to keep some compilers happy. */ ipliteral_router_options_block ipliteral_router_option_defaults = { 0 }; +#ifdef MACRO_PREDEF + +/* Dummy entries */ +void ipliteral_router_init(router_instance *rblock) {} +int ipliteral_router_entry(router_instance *rblock, address_item *addr, + struct passwd *pw, int verify, address_item **addr_local, + address_item **addr_remote, address_item **addr_new, + address_item **addr_succeed) {return 0;} + +#else /*!MACRO_PREDEF*/ + /************************************************* * Initialization entry point * @@ -45,7 +58,6 @@ ipliteral_router_init(router_instance *rblock) ipliteral_router_options_block *ob = (ipliteral_router_options_block *)(rblock->options_block); */ -rblock = rblock; } @@ -104,9 +116,6 @@ const uschar *ip; int len = Ustrlen(domain); int rc, ipv; -addr_new = addr_new; /* Keep picky compilers happy */ -addr_succeed = addr_succeed; - DEBUG(D_route) debug_printf("%s router called for %s: domain = %s\n", rblock->name, addr->address, addr->domain); @@ -138,7 +147,7 @@ if (verify_check_this_host(CUSS&rblock->ignore_target_hosts, /* Set up a host item */ -h = store_get(sizeof(host_item)); +h = store_get(sizeof(host_item), GET_UNTAINTED); h->next = NULL; h->address = string_copy(ip); @@ -165,13 +174,13 @@ addr->host_list = h; /* Set up the errors address, if any. */ -rc = rf_get_errors_address(addr, rblock, verify, &(addr->p.errors_address)); +rc = rf_get_errors_address(addr, rblock, verify, &addr->prop.errors_address); if (rc != OK) return rc; -/* Set up the additional and removeable headers for this address. */ +/* Set up the additional and removable headers for this address. */ -rc = rf_get_munge_headers(addr, rblock, &(addr->p.extra_headers), - &(addr->p.remove_headers)); +rc = rf_get_munge_headers(addr, rblock, &addr->prop.extra_headers, + &addr->prop.remove_headers); if (rc != OK) return rc; /* Fill in the transport, queue the address for local or remote delivery, and @@ -190,4 +199,5 @@ return rf_queue_add(addr, addr_local, addr_remote, rblock, pw)? OK : DEFER; } +#endif /*!MACRO_PREDEF*/ /* End of routers/ipliteral.c */