Announcement

Collapse
No announcement yet.

javascript: IsInNet

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • javascript: IsInNet

    Arguing out an issue here.. and I cna't code to save myself, so cannot generate code to prove my side of the argument...

    Feedback greatly appreciated.

    From a proxy.pac file

    if (isInNet(myIpAddress(), "192.1.0.0", "255.255.0.0"))
    return "PROXY PROXY1:8080";

    My argument is:
    My ip address is 192.168.3.1/255.255.255.0 then it doesn't match that entry because the string is different, regardless of how it may be handled down at the network layers

    My colleague argues, based on network fundamentals (which I'm not faulting in usual circumstances)
    Is that if my ip address is 192.1.3.1/255.255.255.0 it WILL match that entry because network topology would do that.
    Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

  • #2
    Re: javascript: IsInNet

    is the 192.1.0.0 a typo or is the 192.168.3.1 a typo?
    Marcel
    Technical Consultant
    Netherlands
    http://www.phetios.com
    http://blog.nessus.nl

    MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
    "No matter how secure, there is always the human factor."

    "Enjoy life today, tomorrow may never come."
    "If you're going through hell, keep going. ~Winston Churchill"

    Comment


    • #3
      Re: javascript: IsInNet

      I assume it will not look at YOUR subnet mask, just compare your IP with the subnet and mask provided (presumably by converting each into a 32-bit array and testing the first n bits (from the mask) agree

      So in this case your address would match the given subnet for the first 16 bits and return true
      The documentation online seems to suggest this, but can't find a good example
      Tom Jones
      MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
      PhD, MSc, FIAP, MIITT
      IT Trainer / Consultant
      Ossian Ltd
      Scotland

      ** Remember to give credit where credit is due and leave reputation points where appropriate **

      Comment


      • #4
        Re: javascript: IsInNet

        the 192.1 should have been 192.168

        thanks for your replies folks
        Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

        Comment

        Working...
        X