Révision 1643e1fc
Ajouté par Ermal il y a presque 10 ans
pfPorts/php55-pfSense-module/files/pfSense.c | ||
---|---|---|
765 | 765 |
xent->tbl = (u_int16_t)table; |
766 | 766 |
|
767 | 767 |
if (strchr(ip, ':')) { |
768 |
if (!inet_pton(AF_INET6, ip, &xent->k.mix.addr)) {
|
|
768 |
if (!inet_pton(AF_INET6, ip, &xent->k.addr6)) {
|
|
769 | 769 |
efree(op3); |
770 | 770 |
RETURN_FALSE; |
771 | 771 |
} |
772 |
} else if (!inet_pton(AF_INET, ip, &xent->k.mix.addr)) {
|
|
772 |
} else if (!inet_pton(AF_INET, ip, &xent->k.addr6)) {
|
|
773 | 773 |
efree(op3); |
774 | 774 |
RETURN_FALSE; |
775 | 775 |
} |
... | ... | |
783 | 783 |
xent->value = (u_int32_t)pipe; |
784 | 784 |
|
785 | 785 |
if (mac_len > 0) { |
786 |
if (ether_aton_r(mac, (struct ether_addr *)&xent->k.mix.mac) == NULL) {
|
|
786 |
if (ether_aton_r(mac, (struct ether_addr *)&xent->mac_addr) == NULL) {
|
|
787 | 787 |
efree(op3); |
788 | 788 |
RETURN_FALSE; |
789 | 789 |
} |
790 |
xent->masklen += ETHER_ADDR_LEN; |
|
790 |
//xent->masklen += ETHER_ADDR_LEN;
|
|
791 | 791 |
} |
792 | 792 |
|
793 |
xent->type = IPFW_TABLE_MIX;
|
|
793 |
xent->type = IPFW_TABLE_CIDR;
|
|
794 | 794 |
size = sizeof(*op3) + sizeof(*xent); |
795 | 795 |
err = setsockopt(PFSENSE_G(ipfw), IPPROTO_IP, IP_FW3, op3, size); |
796 | 796 |
if (err < 0 && err != EEXIST) { |
Formats disponibles : Unified diff
Correct module code to work correctly for the tables on IPFW with corret type.