| 512 | } |
| 513 | |
| 514 | static int |
| 515 | isrfc1918addr(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 | |
| 530 | static int |
| 531 | stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) |
no outgoing calls
no test coverage detected