Mercurial > ecos
diff packages/net/common/current/src/dhcp_prot.c @ 1632:a5c7a6799462
+ * src/bootp_support.c (get_bootp_option, show_bootp):
+ * src/dhcp_prot.c (scan_dhcp_size): Fixed bug that didn't handle
+ the pad option.
| author | asl |
|---|---|
| date | Thu, 13 May 2004 10:00:35 +0000 |
| parents | 3d8f3b1724be |
| children | 2de3997bad7b |
line wrap: on
line diff
--- a/packages/net/common/current/src/dhcp_prot.c +++ b/packages/net/common/current/src/dhcp_prot.c @@ -110,8 +110,14 @@ scan_dhcp_size( struct bootp *ppkt ) return NULL; } op += 4; + + // This will only scan the options field. while (*op != TAG_END) { - op += *(op+1)+2; + if ( *op == TAG_PAD ) { + op++; + } else { + op += *(op+1)+2; + } if ( op > &ppkt->bp_vend[BP_VEND_LEN-1] ) { CYG_FAIL( "Oversize DHCP packet in dhcp_size" ); return NULL;
