From: Mark Wooding Date: Mon, 25 Jun 2007 22:18:18 +0000 (+0100) Subject: socket: Get address option defaults correctly. X-Git-Tag: 1.3.0~7 X-Git-Url: https://git.distorted.org.uk/~mdw/fwd/commitdiff_plain/b374625fc45476149e33c83530bfc989d353f56d socket: Get address option defaults correctly. Ooops: we'd overwrite the address-family-specific defaults with the generic ones. --- diff --git a/socket.c b/socket.c index c92faad..c85c2d4 100644 --- a/socket.c +++ b/socket.c @@ -372,9 +372,10 @@ static source *ssource_read(scanner *sc) ss->a = getaddr(sc, ADDR_SRC); if (ss->a->ops->initsrcopts) ss->ao = ss->a->ops->initsrcopts(); - else + else { ss->ao = CREATE(addr_opts); - *ss->ao = gsao; + *ss->ao = gsao; + } ss->o = ssgo; return (&ss->s); } @@ -633,9 +634,10 @@ static target *starget_read(scanner *sc) st->a = getaddr(sc, ADDR_DEST); if (st->a->ops->inittargopts) st->ao = st->a->ops->inittargopts(); - else + else { st->ao = CREATE(addr_opts); - *st->ao = gtao; + *st->ao = gtao; + } dstr_puts(&d, "socket."); st->a->ops->print(st->a, ADDR_DEST, &d); st->t.desc = xstrdup(d.buf);