Skip to content

Commit b157e6c

Browse files
committed
Fix issue with DNS lookup rule (local port wildcard).
1 parent 0700af6 commit b157e6c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/netxduo/packet_filter_glue.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -814,21 +814,23 @@ int wolfsentry_netx_ip_packet_filter(struct wolfsentry_context* ctx, unsigned ch
814814
parse_result = parse_ip_packet(packet_data, data_length,
815815
local_addr, remote_addr, &local_port, &remote_port, &protocol, 0);
816816
if (parse_result != 0) {
817-
/* If we can't parse the packet, accept it by default */
817+
/* If we can't parse the packet, reject by default */
818818
return NX_NOT_SUCCESSFUL;
819819
}
820820

821821
/* Build wolfSentry sockaddr structures */
822-
if (build_wolfsentry_sockaddr(local_sockaddr, local_addr, local_port, protocol, interface_id) != 0 ||
823-
build_wolfsentry_sockaddr(remote_sockaddr, remote_addr, remote_port, protocol, interface_id) != 0) {
824-
/* If we can't build sockaddr structures, accept packet by default */
822+
if (build_wolfsentry_sockaddr(local_sockaddr, local_addr, local_port,
823+
protocol, interface_id) != 0 ||
824+
build_wolfsentry_sockaddr(remote_sockaddr, remote_addr, remote_port,
825+
protocol, interface_id) != 0) {
826+
/* If we can't build sockaddr structures, reject packet by default */
825827
return NX_NOT_SUCCESSFUL;
826828
}
827829

828830
/* Set route flags for inbound packet */
829831
route_flags = WOLFSENTRY_ROUTE_FLAG_DIRECTION_IN |
830832
WOLFSENTRY_ROUTE_FLAG_SA_REMOTE_ADDR_WILDCARD |
831-
WOLFSENTRY_ROUTE_FLAG_SA_REMOTE_PORT_WILDCARD;
833+
WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_PORT_WILDCARD;
832834

833835
/* Initialize action results */
834836
action_results = WOLFSENTRY_ACTION_RES_NONE;

0 commit comments

Comments
 (0)