Lines 716-721
Link Here
|
716 |
#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) |
716 |
#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) |
717 |
#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) |
717 |
#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) |
718 |
#define LENCIDNS(neg) (neg ? (CILEN_ADDR) : 0) |
718 |
#define LENCIDNS(neg) (neg ? (CILEN_ADDR) : 0) |
|
|
719 |
#define LENCIWINS(neg) LENCIADDR(neg) |
719 |
|
720 |
|
720 |
/* |
721 |
/* |
721 |
* First see if we want to change our options to the old |
722 |
* First see if we want to change our options to the old |
Lines 737-743
Link Here
|
737 |
LENCIVJ(go->neg_vj, go->old_vj) + |
738 |
LENCIVJ(go->neg_vj, go->old_vj) + |
738 |
LENCIADDR(go->neg_addr) + |
739 |
LENCIADDR(go->neg_addr) + |
739 |
LENCIDNS(go->req_dns1) + |
740 |
LENCIDNS(go->req_dns1) + |
740 |
LENCIDNS(go->req_dns2)) ; |
741 |
LENCIDNS(go->req_dns2) + |
|
|
742 |
LENCIWINS(go->winsaddr[0]) + |
743 |
LENCIWINS(go->winsaddr[1])) ; |
741 |
} |
744 |
} |
742 |
|
745 |
|
743 |
|
746 |
|
Lines 810-815
Link Here
|
810 |
} else \ |
813 |
} else \ |
811 |
neg = 0; \ |
814 |
neg = 0; \ |
812 |
} |
815 |
} |
|
|
816 |
|
817 |
#define ADDCIWINS(opt, addr) \ |
818 |
if (addr) { \ |
819 |
if (len >= CILEN_ADDR) { \ |
820 |
u_int32_t l; \ |
821 |
PUTCHAR(opt, ucp); \ |
822 |
PUTCHAR(CILEN_ADDR, ucp); \ |
823 |
l = ntohl(addr); \ |
824 |
PUTLONG(l, ucp); \ |
825 |
len -= CILEN_ADDR; \ |
826 |
} else \ |
827 |
addr = 0; \ |
828 |
} |
813 |
|
829 |
|
814 |
ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, |
830 |
ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, |
815 |
go->hisaddr); |
831 |
go->hisaddr); |
Lines 823-828
Link Here
|
823 |
|
839 |
|
824 |
ADDCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); |
840 |
ADDCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); |
825 |
|
841 |
|
|
|
842 |
ADDCIWINS(CI_MS_WINS1, go->winsaddr[0]); |
843 |
|
844 |
ADDCIWINS(CI_MS_WINS2, go->winsaddr[1]); |
845 |
|
826 |
*lenp -= len; |
846 |
*lenp -= len; |
827 |
} |
847 |
} |
828 |
|
848 |
|
Lines 1159-1164
Link Here
|
1159 |
try.neg_addr = 1; |
1179 |
try.neg_addr = 1; |
1160 |
no.neg_addr = 1; |
1180 |
no.neg_addr = 1; |
1161 |
break; |
1181 |
break; |
|
|
1182 |
case CI_MS_WINS1: |
1183 |
case CI_MS_WINS2: |
1184 |
if (cilen != CILEN_ADDR) |
1185 |
goto bad; |
1186 |
GETLONG(l, p); |
1187 |
ciaddr1 = htonl(l); |
1188 |
if (ciaddr1) |
1189 |
try.winsaddr[citype == CI_MS_WINS2] = ciaddr1; |
1190 |
break; |
1162 |
} |
1191 |
} |
1163 |
p = next; |
1192 |
p = next; |
1164 |
} |
1193 |
} |
Lines 1275-1280
Link Here
|
1275 |
try.neg = 0; \ |
1304 |
try.neg = 0; \ |
1276 |
} |
1305 |
} |
1277 |
|
1306 |
|
|
|
1307 |
#define REJCIWINS(opt, addr) \ |
1308 |
if (addr && \ |
1309 |
((cilen = p[1]) == CILEN_ADDR) && \ |
1310 |
len >= cilen && \ |
1311 |
p[0] == opt) { \ |
1312 |
u_int32_t l; \ |
1313 |
len -= cilen; \ |
1314 |
INCPTR(2, p); \ |
1315 |
GETLONG(l, p); \ |
1316 |
cilong = htonl(l); \ |
1317 |
/* Check rejected value. */ \ |
1318 |
if (cilong != addr) \ |
1319 |
goto bad; \ |
1320 |
try.winsaddr[opt == CI_MS_WINS2] = 0; \ |
1321 |
} |
1278 |
|
1322 |
|
1279 |
REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, |
1323 |
REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, |
1280 |
go->ouraddr, go->hisaddr); |
1324 |
go->ouraddr, go->hisaddr); |
Lines 1288-1293
Link Here
|
1288 |
|
1332 |
|
1289 |
REJCIDNS(CI_MS_DNS2, req_dns2, go->dnsaddr[1]); |
1333 |
REJCIDNS(CI_MS_DNS2, req_dns2, go->dnsaddr[1]); |
1290 |
|
1334 |
|
|
|
1335 |
REJCIWINS(CI_MS_WINS1, go->winsaddr[0]); |
1336 |
|
1337 |
REJCIWINS(CI_MS_WINS2, go->winsaddr[1]); |
1338 |
|
1291 |
/* |
1339 |
/* |
1292 |
* If there are any remaining CIs, then this packet is bad. |
1340 |
* If there are any remaining CIs, then this packet is bad. |
1293 |
*/ |
1341 |
*/ |