mirror of
https://github.com/NetworkConfiguration/dhcpcd.git
synced 2026-01-26 06:07:57 +00:00
Fix building with different options
Fixes #458. Add many build options to the NetBSD target Set any warnings to be errors as NetBSD should build without any warnings. DragonFly as well, but we don't have a target for that.
This commit is contained in:
parent
4d583c4f41
commit
491cc3eebf
26
.github/workflows/build.yml
vendored
26
.github/workflows/build.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Configure
|
||||
run: ./configure --prefix=/usr
|
||||
run: ./configure
|
||||
|
||||
- name: Build
|
||||
run: make
|
||||
@ -44,9 +44,7 @@ jobs:
|
||||
git clone --depth=1 "${{ github.server_url }}/${{ github.repository }}" build
|
||||
cd build
|
||||
[ "${{ github.event.pull_request.number }}" = "" ] || (echo "fetching PR ${{ github.event.pull_request.number }}"; git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} && git checkout "pr-${{ github.event.pull_request.number }}")
|
||||
echo "configure"
|
||||
./configure --prefix=/usr
|
||||
echo "building"
|
||||
./configure
|
||||
make
|
||||
|
||||
- name: Tests
|
||||
@ -71,9 +69,7 @@ jobs:
|
||||
git clone --depth=1 "${{ github.server_url }}/${{ github.repository }}" build
|
||||
cd build
|
||||
[ "${{ github.event.pull_request.number }}" = "" ] || (echo "fetching PR ${{ github.event.pull_request.number }}"; git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} && git checkout "pr-${{ github.event.pull_request.number }}")
|
||||
echo "configure"
|
||||
./configure --prefix=/usr
|
||||
echo "building"
|
||||
./configure
|
||||
make
|
||||
|
||||
- name: Tests
|
||||
@ -82,6 +78,18 @@ jobs:
|
||||
make tests
|
||||
|
||||
netbsd:
|
||||
strategy:
|
||||
matrix:
|
||||
args:
|
||||
-
|
||||
- --disable-ipv4
|
||||
- --disable-arp
|
||||
- --disable-ipv4ll
|
||||
- --disable-ipv6
|
||||
- --disable-dhcp6
|
||||
cppflags:
|
||||
-
|
||||
- -DSMALL
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Bootstrap NetBSD-latest
|
||||
@ -94,9 +102,7 @@ jobs:
|
||||
git clone --depth=1 "${{ github.server_url }}/${{ github.repository }}" build
|
||||
cd build
|
||||
[ "${{ github.event.pull_request.number }}" = "" ] || (echo "fetching PR ${{ github.event.pull_request.number }}"; git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} && git checkout "pr-${{ github.event.pull_request.number }}")
|
||||
echo "configure"
|
||||
./configure --prefix=/usr
|
||||
echo "building"
|
||||
CFLAGS=-Werror CPPFLAGS="${{ matrix.cppflags }}" ./configure ${{ matrix.args }}
|
||||
make
|
||||
|
||||
- name: Tests
|
||||
|
||||
@ -3068,7 +3068,7 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len,
|
||||
struct dhcp_state *state = D_STATE(ifp);
|
||||
struct if_options *ifo = ifp->options;
|
||||
struct dhcp_lease *lease = &state->lease;
|
||||
uint8_t type, tmp;
|
||||
uint8_t type;
|
||||
struct in_addr addr;
|
||||
unsigned int i;
|
||||
char *msg;
|
||||
@ -3079,6 +3079,9 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len,
|
||||
const uint8_t *auth;
|
||||
size_t auth_len;
|
||||
#endif
|
||||
#ifdef IPV4LL
|
||||
uint8_t tmp;
|
||||
#endif
|
||||
#ifdef IN_IFF_DUPLICATED
|
||||
struct ipv4_addr *ia;
|
||||
#endif
|
||||
|
||||
@ -650,13 +650,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
|
||||
ssize_t s;
|
||||
struct in_addr addr, addr2;
|
||||
in_addr_t *naddr;
|
||||
struct rt *rt;
|
||||
const struct dhcp_opt *d, *od;
|
||||
uint8_t *request, *require, *no, *reject;
|
||||
struct dhcp_opt **dop, *ndop;
|
||||
size_t *dop_len, dl, odl;
|
||||
struct vivco *vivco;
|
||||
const struct vivco *vivco_endp = ifo->vivco + ifo->vivco_len;
|
||||
struct group *grp;
|
||||
#ifdef AUTH
|
||||
struct token *token;
|
||||
@ -664,17 +661,26 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
|
||||
#ifdef _REENTRANT
|
||||
struct group grpbuf;
|
||||
#endif
|
||||
#ifdef INET
|
||||
struct rt *rt;
|
||||
#endif
|
||||
#ifdef DHCP6
|
||||
size_t sl;
|
||||
struct if_ia *ia;
|
||||
uint8_t iaid[4];
|
||||
#endif
|
||||
#if defined(DHCP6) || ((defined(INET) || defined(INET6)) && !defined(SMALL))
|
||||
size_t sl;
|
||||
#endif
|
||||
#ifndef SMALL
|
||||
struct in6_addr in6addr;
|
||||
#ifdef DHCP6
|
||||
struct if_sla *sla, *slap;
|
||||
#endif
|
||||
struct vivco *vivco;
|
||||
const struct vivco *vivco_endp = ifo->vivco + ifo->vivco_len;
|
||||
struct in6_addr in6addr;
|
||||
struct vsio **vsiop = NULL, *vsio;
|
||||
size_t *vsio_lenp = NULL, opt_max, opt_header;
|
||||
struct vsio_so *vsio_so;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
dop = NULL;
|
||||
@ -1308,6 +1314,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
|
||||
strncmp(arg, "ms_classless_static_routes=",
|
||||
strlen("ms_classless_static_routes=")) == 0)
|
||||
{
|
||||
#ifdef INET
|
||||
struct in_addr addr3;
|
||||
|
||||
if (p == NULL) {
|
||||
@ -1337,7 +1344,12 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
|
||||
sa_in_init(&rt->rt_gateway, &addr3);
|
||||
if (rt_proto_add_ctx(&ifo->routes, rt, ctx))
|
||||
add_environ(&ifo->config, arg, 0);
|
||||
#else
|
||||
logerrx("no inet support for option: %s", arg);
|
||||
return -1;
|
||||
#endif
|
||||
} else if (strncmp(arg, "routers=", strlen("routers=")) == 0) {
|
||||
#ifdef INET
|
||||
if (p == NULL) {
|
||||
rt_headclear(&ifo->routes, AF_INET);
|
||||
add_environ(&ifo->config, arg, 1);
|
||||
@ -1353,6 +1365,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
|
||||
sa_in_init(&rt->rt_gateway, &addr);
|
||||
if (rt_proto_add_ctx(&ifo->routes, rt, ctx))
|
||||
add_environ(&ifo->config, arg, 0);
|
||||
#else
|
||||
logerrx("no inet support for option: %s", arg);
|
||||
return -1;
|
||||
#endif
|
||||
} else if (strncmp(arg, "interface_mtu=",
|
||||
strlen("interface_mtu=")) == 0 ||
|
||||
strncmp(arg, "mtu=", strlen("mtu=")) == 0)
|
||||
@ -1366,6 +1382,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
|
||||
return -1;
|
||||
}
|
||||
} else if (strncmp(arg, "ip6_address=", strlen("ip6_address=")) == 0) {
|
||||
#ifdef INET6
|
||||
if (p == NULL) {
|
||||
memset(&ifo->req_addr6, 0,
|
||||
sizeof(ifo->req_addr6));
|
||||
@ -1396,6 +1413,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
|
||||
sizeof(ifo->req_addr6));
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
logerrx("no inet6 support for option: %s", arg);
|
||||
return -1;
|
||||
#endif
|
||||
} else
|
||||
add_environ(&ifo->config, arg, p == NULL ? 1 : 0);
|
||||
break;
|
||||
@ -2951,11 +2972,11 @@ free_options(struct dhcpcd_ctx *ctx, struct if_options *ifo)
|
||||
struct rt *rt;
|
||||
#endif
|
||||
struct dhcp_opt *opt;
|
||||
struct vivco *vo;
|
||||
#ifdef AUTH
|
||||
struct token *token;
|
||||
#endif
|
||||
#ifndef SMALL
|
||||
struct vivco *vo;
|
||||
struct vsio *vsio;
|
||||
struct vsio_so *vsio_so;
|
||||
#endif
|
||||
|
||||
@ -626,7 +626,7 @@ ipv6_deletedaddr(struct ipv6_addr *ia)
|
||||
#endif
|
||||
|
||||
#if !defined(DHCP6) || (!defined(PRIVSEP) && defined(SMALL))
|
||||
UNUSED(ia)
|
||||
UNUSED(ia);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -215,6 +215,7 @@ ps_inet_startcb(struct ps_process *psp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(INET) || defined(DHCP6)
|
||||
static bool
|
||||
ps_inet_validudp(struct msghdr *msg, uint16_t sport, uint16_t dport)
|
||||
{
|
||||
@ -233,6 +234,7 @@ ps_inet_validudp(struct msghdr *msg, uint16_t sport, uint16_t dport)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef INET6
|
||||
static bool
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user