Fixed an issue in options processing on TUN and DNS flags

This commit is contained in:
Gerhard Rieger 2017-01-22 18:48:53 +01:00
parent b43c30b6b9
commit 682a12e00e
2 changed files with 4 additions and 1 deletions

View file

@ -73,6 +73,9 @@ corrections:
TTL: 4 bytes), the old implementation failed for TTL on big-endian TTL: 4 bytes), the old implementation failed for TTL on big-endian
hosts. 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: porting:
Type conflict between int and sig_atomic_t between declaration and Type conflict between int and sig_atomic_t between declaration and
definition of diag_immediate_type and diag_immediate_exit broke definition of diag_immediate_type and diag_immediate_exit broke

View file

@ -4002,7 +4002,7 @@ int applyopts_single(struct single *xfd, struct opt *opts, enum e_phase phase) {
void *masks = (char *)xfd + opt->desc->major; void *masks = (char *)xfd + opt->desc->major;
size_t masksize = opt->desc->minor; size_t masksize = opt->desc->minor;
unsigned long bit = opt->desc->arg3; unsigned long bit = opt->desc->arg3;
switch (masksize) { switch (masksize>>1) {
case sizeof(uint16_t): case sizeof(uint16_t):
if (opt->value.u_bool) { if (opt->value.u_bool) {
((uint16_t *)masks)[0] |= bit; ((uint16_t *)masks)[0] |= bit;