diff options
author | 2013-05-08 06:24:44 +0000 | |
---|---|---|
committer | 2013-05-08 06:24:44 +0000 | |
commit | 2f04e6ba5eeeccb4cdfcd01caa0138eaf91371b6 (patch) | |
tree | b30bf24f8b3de0aec5a97ef31dc711d4d4285a89 | |
parent | We have fdatasync() and pselect() now, so uncomment them in the list of (diff) | |
download | wireguard-openbsd-2f04e6ba5eeeccb4cdfcd01caa0138eaf91371b6.tar.xz wireguard-openbsd-2f04e6ba5eeeccb4cdfcd01caa0138eaf91371b6.zip |
Correctly compute packet size when including DNS search lists.
From Stephane A. Sezer
ok bluhm@
-rw-r--r-- | usr.sbin/rtadvd/config.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index f6e22849280..c2a378d0012 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.33 2013/04/30 12:30:40 florian Exp $ */ +/* $OpenBSD: config.c,v 1.34 2013/05/08 06:24:44 brad Exp $ */ /* $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */ /* @@ -723,8 +723,12 @@ make_packet(struct rainfo *rainfo) packlen += sizeof(struct nd_opt_dnssl); + /* + * Each domain in the packet ends with a null byte. Account for + * that here. + */ TAILQ_FOREACH(dnsd, &dsl->dnssldoms, entry) - domains_size += dnsd->length; + domains_size += dnsd->length + 1; domains_size = (domains_size + 7) & ~7; @@ -849,7 +853,7 @@ make_packet(struct rainfo *rainfo) size = 0; TAILQ_FOREACH(dnsd, &dsl->dnssldoms, entry) - size += dnsd->length; + size += dnsd->length + 1; /* align size on the next 8 byte boundary */ size = (size + 7) & ~7; ndopt_dnssl->nd_opt_dnssl_len = 1 + size / 8; |