in reply to Re^3: Help with Lorcon XS library
in thread Help with Lorcon XS library

Hi, unfortunately the program dies (I've already done some test and i am not surprised) the die message is:  [-] Unable to find DRV for [iwlwifi] update Hi again, the problem persists only in the 2 functions ( lorcon_find_driver and  lorcon_create , some functions ( like the lorcon_list_drivers ) works properly while other which need the $context ( aka the  Net::Lorcon2::lorcon_create) crashes ( I think the problem is linked to the  lorcon_create. regards Edoardo M.

Replies are listed 'Best First'.
Re^5: Help with Lorcon XS library
by syphilis (Archbishop) on Jul 21, 2020 at 11:41 UTC
    some functions ( like the lorcon_list_drivers ) works properly

    I don't know much about Net::Lorcon2, but I'm guessing that the string that you assign to $driver must be the same as one of the strings listed by lorcon_list_drivers().
    What happens if you assign those strings (as shown by Dumper(\@cards)) to $driver ?
    Could you provide us with the output of Dumper(\@cards) from that second program I posted.

    Cheers,
    Rob

      If this is the lorcon in question:

      Current State: The lorcon2 rewrite currently only supports the mac80211 driver, additional drivers will be restored over time
        HI marto! my network card has a mac80211 driver, I controlled now. Regards Edoardo M
      Hi the output of the
      lorcon_lsit_driver is: $VAR1 = [ { 'name' => 'rtfile', 'details' => 'Real-time PCAP file source' }, { 'details' => 'PCAP file source', 'name' => 'file' }, { 'name' => 'madwifing', 'details' => 'Linux madwifi-ng drivers, deprecated by ath5 +k and ath9k' }, { 'name' => 'tuntap', 'details' => 'Linux tuntap virtual interface drivers' } ];
      I have already tried if I use:
      print Net::Lorcon2::lorcon_create("wlo1", $driver); #where $driver c +an be madwifing or other it says: Net::Lorcon2::lorcon_create: driver is not a reference at -e line 3.
      and if I do
      print Net::Lorcon2::lorcon_create("wlo1", \$driver); #where $driver + can be madwifing or other it says segmentation error (core dump created)
      Regards. Edoardo
        print Net::Lorcon2::lorcon_create("wlo1", $driver); #where $driver c +an be madwifing or other it says: Net::Lorcon2::lorcon_create: driver is not a reference at -e line 3.


        Yes - you should not do that.
        As the error message says $driver is not a reference.

        print Net::Lorcon2::lorcon_create("wlo1", \$driver); #where $driver + can be madwifing or other it says segmentation error (core dump created)


        Yes - you should not do that either. At least, this time you have passed something that is a reference.
        But it's not a reference to the right thing, and therefore causes a segfault.

        As I said in my first post, the correct thing to do would be:
        my $driver = "madwifing"; my $if = "wlo1"; my $drv = lorcon_find_driver($driver); if (! $drv) { print STDERR "[-] Unable to find DRV for [$driver]\n"; exit 1; } my $lorcon = lorcon_create($if, $drv); if (! $lorcon) { print STDERR "[-] lorcon_create failed\n"; exit 1; }
        What happens if you do that ?
        In view of what marto dug up, it may not work either - but it's at least worth a try.

        Cheers,
        Rob