From 682a12e00e8baecdb8aabe8bee203098f90c347c Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Sun, 22 Jan 2017 18:48:53 +0100 Subject: [PATCH] Fixed an issue in options processing on TUN and DNS flags --- CHANGES | 3 +++ xioopts.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8c20c72..d304199 100644 --- a/CHANGES +++ b/CHANGES @@ -73,6 +73,9 @@ corrections: TTL: 4 bytes), the old implementation failed for TTL on big-endian hosts. + Fixed an issue in options processing: TUN and DNS flags had failed on + big-endian systems and the NO- forms had probable never worked. + porting: Type conflict between int and sig_atomic_t between declaration and definition of diag_immediate_type and diag_immediate_exit broke diff --git a/xioopts.c b/xioopts.c index 012b6b9..9ea6ce4 100644 --- a/xioopts.c +++ b/xioopts.c @@ -4002,7 +4002,7 @@ int applyopts_single(struct single *xfd, struct opt *opts, enum e_phase phase) { void *masks = (char *)xfd + opt->desc->major; size_t masksize = opt->desc->minor; unsigned long bit = opt->desc->arg3; - switch (masksize) { + switch (masksize>>1) { case sizeof(uint16_t): if (opt->value.u_bool) { ((uint16_t *)masks)[0] |= bit;