/[radius]/radius/lib/radpdu.c
ViewVC logotype

Diff of /radius/lib/radpdu.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by gray, Fri Sep 12 13:41:09 2003 UTC revision 1.15 by gray, Tue Sep 30 15:24:52 2003 UTC
# Line 228  rad_create_pdu(void **rptr, int code, in Line 228  rad_create_pdu(void **rptr, int code, in
228                  rad_attr_init(&attr);                  rad_attr_init(&attr);
229                  if ((vendorcode = VENDOR(pair->attribute)) > 0                  if ((vendorcode = VENDOR(pair->attribute)) > 0
230                      && (vendorpec  = vendor_id_to_pec(vendorcode)) > 0) {                      && (vendorpec  = vendor_id_to_pec(vendorcode)) > 0) {
                         u_char c;  
                           
231                          attr.attrno = DA_VENDOR_SPECIFIC;                          attr.attrno = DA_VENDOR_SPECIFIC;
232                          lval = htonl(vendorpec);                          lval = htonl(vendorpec);
233                          rad_attr_write(&attr, &lval, 4);                          rad_attr_write(&attr, &lval, 4);
234                          c = pair->attribute & 0xff;                          if (vendorpec == 429) {
235                          rad_attr_write(&attr, &c, 1);                                  /* Hack for non-compliant USR VSA */
236                          rad_attr_write(&attr, &lval, 1); /* Reserve a byte */                                  UINT4 atval = htonl(pair->attribute & 0xffff);
237                          attrlen = rad_encode_pair(&attr, pair);                                  rad_attr_write(&attr, &atval, 4);
238                          attr.data[5] = 2+attrlen; /* Fill in the length */                                  attrlen = rad_encode_pair(&attr, pair);
239                            } else {
240                                    u_char c = pair->attribute & 0xff;
241                                    rad_attr_write(&attr, &c, 1);
242                                    /* Reserve a length byte */
243                                    rad_attr_write(&attr, &lval, 1);
244                                    attrlen = rad_encode_pair(&attr, pair);
245                                    /* Fill in the length */
246                                    attr.data[5] = 2+attrlen;
247                            }
248                  } else if (pair->attribute > 0xff)                  } else if (pair->attribute > 0xff)
249                          continue;                          continue;
250                  else {                  else {
# Line 453  rad_decode_pdu(UINT4 host, u_short udp_p Line 460  rad_decode_pdu(UINT4 host, u_short udp_p
460                                          ptr += 4;                                          ptr += 4;
461                                          attrlen -= 4;                                          attrlen -= 4;
462                                          len = attrlen;                                          len = attrlen;
463                                            attrlen = 0;
464                                  } else {                                  } else {
465                                          attrno = *ptr++ | (vendorcode << 16);                                          attrno = *ptr++ | (vendorcode << 16);
466                                          len = *ptr++ - 2;                                          len = *ptr++ - 2;
467                                            attrlen -= len + 2;
468                                  }                                  }
469                                                                    
470                                  pair = rad_decode_pair(attrno, ptr, len);                                  pair = rad_decode_pair(attrno, ptr, len);
# Line 467  rad_decode_pdu(UINT4 host, u_short udp_p Line 476  rad_decode_pdu(UINT4 host, u_short udp_p
476                                          prev = pair;                                          prev = pair;
477                                  }                                  }
478                                  ptr += len;                                  ptr += len;
                                 attrlen -= len + 2;  
479                          }                          }
480                  } else {                  } else {
481                          pair = rad_decode_pair(attrno, ptr, attrlen);                          pair = rad_decode_pair(attrno, ptr, attrlen);

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26