Changeset 12373
- Timestamp:
- 06/25/2009 11:26:47 AM (9 months ago)
- Files:
-
- src/router/pppd.new/pppd/ipcp.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/router/pppd.new/pppd/ipcp.c
r7833 r12373 722 722 #define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) 723 723 #define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) 724 #define LENCIDNS(neg) (neg ? (CILEN_ADDR) : 0) 724 #define LENCIDNS(neg) LENCIADDR(neg) 725 #define LENCIWINS(neg) LENCIADDR(neg) 725 726 726 727 /* … … 744 745 LENCIADDR(go->neg_addr) + 745 746 LENCIDNS(go->req_dns1) + 746 LENCIDNS(go->req_dns2)) ; 747 LENCIDNS(go->req_dns2) + 748 LENCIWINS(go->winsaddr[0]) + 749 LENCIWINS(go->winsaddr[1])) ; 747 750 } 748 751 … … 818 821 } 819 822 823 #define ADDCIWINS(opt, addr) \ 824 if (addr) { \ 825 if (len >= CILEN_ADDR) { \ 826 u_int32_t l; \ 827 PUTCHAR(opt, ucp); \ 828 PUTCHAR(CILEN_ADDR, ucp); \ 829 l = ntohl(addr); \ 830 PUTLONG(l, ucp); \ 831 len -= CILEN_ADDR; \ 832 } else \ 833 addr = 0; \ 834 } 835 820 836 ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, 821 837 go->hisaddr); … … 830 846 ADDCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); 831 847 848 ADDCIWINS(CI_MS_WINS1, go->winsaddr[0]); 849 850 ADDCIWINS(CI_MS_WINS2, go->winsaddr[1]); 851 832 852 *lenp -= len; 833 853 } … … 1166 1186 no.neg_addr = 1; 1167 1187 break; 1188 case CI_MS_WINS1: 1189 case CI_MS_WINS2: 1190 if (cilen != CILEN_ADDR) 1191 goto bad; 1192 GETLONG(l, p); 1193 ciaddr1 = htonl(l); 1194 if (ciaddr1) 1195 try.winsaddr[citype == CI_MS_WINS2] = ciaddr1; 1196 break; 1168 1197 } 1169 1198 p = next; … … 1282 1311 } 1283 1312 1313 #define REJCIWINS(opt, addr) \ 1314 if (addr && \ 1315 ((cilen = p[1]) == CILEN_ADDR) && \ 1316 len >= cilen && \ 1317 p[0] == opt) { \ 1318 u_int32_t l; \ 1319 len -= cilen; \ 1320 INCPTR(2, p); \ 1321 GETLONG(l, p); \ 1322 cilong = htonl(l); \ 1323 /* Check rejected value. */ \ 1324 if (cilong != addr) \ 1325 goto bad; \ 1326 try.winsaddr[opt == CI_MS_WINS2] = 0; \ 1327 } 1284 1328 1285 1329 REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, … … 1294 1338 1295 1339 REJCIDNS(CI_MS_DNS2, req_dns2, go->dnsaddr[1]); 1340 1341 REJCIWINS(CI_MS_WINS1, go->winsaddr[0]); 1342 1343 REJCIWINS(CI_MS_WINS2, go->winsaddr[1]); 1296 1344 1297 1345 /*
