Hi again,
yes, I am considering the idea of donating something,I have good memories linked to Perl, since the start of this summer I started writing some articles for the perl.com, I am still waiting the publication, hope soon.
I am writing again because the "enemy" strickes back, while I was testing the
lorcon_create I tried to put everything into the "new" subroutine for the function initialization, the code is as follows:
sub new {
my (undef, undef, $interface, undef, $driver) = @_;
my $self = shift->SUPER::new(
driver => $driver,
interface => $interface,
@_,
);
my $drv = lorcon_find_driver($self->driver);
if (! $drv) {
die "[*] new: lorcon_find_driver: failed\n";
return;
}
$self->driver( $drv );
my $context = lorcon_create($self->interface, $drv); #_drv
if (! $context) {
die "[*] new: lorcon_create: failed\n";
return;
}
$self->_context($context) or die $!;
return $self;
}
the only big problem stands when I tried to call the setInjectMode it produces a core dump (again).
the code is:
sub setInjectMode {
my $self = shift;
my $r = lorcon_open_inject($self->_context);#->_context);
if ($r == -1) {
die "[*] setInjectMode: lorcon_open_inject: " . lorcon_get_error
+( $self->_context ) . "\n";
return;
}
return 1;
}
I think that there is something wrong in the $self->_context variable, perhaps I haven't understood the use of "_context"
**update**
dumping the Lorcon initialization variable the result was:
$VAR1 = bless( [
\152150320,
'wlo1',
undef,
\152168944
], 'Net::Lorcon2' );
I think that the "undef" is referred to the _drv, the \152150320 is the $driver.
the \152150320 changes to 'madwifing' modifyng those 2 lines
# $self->driver( $drv ) ;
my $context = lorcon_create($self->interface, $drv); #_drv
regards
Edoardo M.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.