Skip to content

NullReference Exception if IPv6 is disabled #38

Open

Description

@VbScrub

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Inveigh.Arguments.ParseArguments() at Inveigh.Program.Main(String[] arguments)

The error comes from line 295 in the Arguments.cs file because it is trying to insert into a null string:

Program.argMAC = Program.argMAC.Insert(2, ":").Insert(5, ":").Insert(8, ":").Insert(11, ":").Insert(14, ":");

The only solution was to enable IPv6 on my network adapter. Even if I use -IPv6 N I still get the error.

Activity

  1. Kevin-Robertson commented on Nov 19, 2021

    @Kevin-Robertson
    Owner

    Thanks, this will be fixed soon. You can also get around it by feeding it a MAC with -MAC. Basically, it only needs the MAC for DHCPv6 spoofing so it's not needed when IPv6 is disabled. I should have included -MAC in the list of paramters that are not required when IPv6 is disabled.

  2. T35R6braPwgDJKq commented on Dec 10, 2021

    @T35R6braPwgDJKq

    thanks - just wrapped the block with if(enabledDHCPv6) - worked

                if (Program.enabledDHCPv6)
                {
                    if (string.IsNullOrEmpty(Program.argMAC))
                    {
    
                        if (string.IsNullOrEmpty(Program.argSnifferIPv6))
                        {
                            Program.argMAC = GetLocalMACAddress(GetLocalIPAddress("IPv6"));
                        }
                        else
                        {
                            Program.argMAC = GetLocalMACAddress(Program.argSnifferIPv6);
                        }
    
                    }
    
                    Program.argMAC = Program.argMAC.Insert(2, ":").Insert(5, ":").Insert(8, ":").Insert(11, ":").Insert(14, ":");
                }
  3. Kevin-Robertson commented on Dec 10, 2021

    @Kevin-Robertson
    Owner

    Thanks! That bug should be fixed in the dev branch version also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions