• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

恥ずかしい勘違いから生まれた、DHCP6の不要かつ部分的な実装


Commit MetaInfo

Revision11500c928ed92f1a0ba7b31598088c776de0ab66 (tree)
Zeit2021-08-12 21:46:20
Autordyknon <dyknon@user...>
Commiterdyknon

Log Message

Leave option body unparsed if error

Ändern Zusammenfassung

Diff

--- a/Net/DHCP6/Exchange/InfoReq.pm
+++ b/Net/DHCP6/Exchange/InfoReq.pm
@@ -51,9 +51,13 @@ sub new {
5151
5252 my @ooro = grep{$_->code == DHCP6_OPT_ORO}@{$opts{options}};
5353 die "there are multiple option request options" if(@ooro >= 2);
54- @{$opts{options}} = grep{$_->code != DHCP6_OPT_ORO}@{$opts{options}};
55- push @{$opts{request}}, $ooro[0]->all_elems if(@ooro);
56- push @{$opts{options}}, d6opt_new_option_request(list => @{$opts{request}});
54+ if(@{$opts{request}}){
55+ die if(!$ooro[0]->isa(Net::DHCP6::Option::OptionRequest));
56+ @{$opts{options}} = grep{$_->code != DHCP6_OPT_ORO}@{$opts{options}};
57+ push @{$opts{request}}, $ooro[0]->all_elems if(@ooro);
58+ push @{$opts{options}},
59+ d6opt_new_option_request(list => @{$opts{request}});
60+ }
5761 delete $opts{request};
5862
5963 my $ocid = grep{$_->code == DHCP6_OPT_CLIENTID}@{$opts{options}};
--- a/Net/DHCP6/Option.pm
+++ b/Net/DHCP6/Option.pm
@@ -51,8 +51,9 @@ sub parse {
5151 die "end of buffer" if(length $data != $len);
5252 $$buf = substr($$buf, 4 + $len);
5353
54- $class = $class->find_subclass($code);
55- $class->new(code => $code, data => $data);
54+ my $subclass = $class->find_subclass($code);
55+ eval{$subclass->new(code => $code, data => $data)}
56+ // $class->new(code => $code, data => $data);
5657 }
5758
5859 sub register_option {