MCPcopy Create free account
hub / github.com/F-Stack/f-stack / isrfc1918addr

Function isrfc1918addr

freebsd/net/if_stf.c:514–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514static int
515isrfc1918addr(struct in_addr *in)
516{
517 /*
518 * returns 1 if private address range:
519 * 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
520 */
521 if (stf_permit_rfc1918 == 0 && (
522 (ntohl(in->s_addr) & 0xff000000) >> 24 == 10 ||
523 (ntohl(in->s_addr) & 0xfff00000) >> 16 == 172 * 256 + 16 ||
524 (ntohl(in->s_addr) & 0xffff0000) >> 16 == 192 * 256 + 168))
525 return 1;
526
527 return 0;
528}
529
530static int
531stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp)

Callers 2

stf_checkaddr4Function · 0.85
stf_ioctlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected