… | |
… | |
127 | u8 |
127 | u8 |
128 | sockinfo::supported_protocols (conf_node *conf) |
128 | sockinfo::supported_protocols (conf_node *conf) |
129 | { |
129 | { |
130 | u8 protocols = prot; |
130 | u8 protocols = prot; |
131 | |
131 | |
132 | if (prot & (PROT_UDPv4 | PROT_TCPv4)) |
132 | if (prot & (PROT_IPv4 | PROT_ICMPv4 | PROT_UDPv4 | PROT_TCPv4)) |
133 | protocols |= PROT_IPv4 | PROT_ICMPv4; |
133 | protocols |= PROT_IPv4 | PROT_ICMPv4; |
134 | |
134 | |
135 | if (conf |
|
|
136 | && prot & PROTv4 |
135 | if (conf && prot & PROTv4) |
137 | && conf->protocols & PROT_UDPv4 |
136 | { |
138 | && conf->udp_port) |
137 | if (conf->protocols & PROT_UDPv4 && conf->udp_port) |
139 | protocols |= PROT_UDPv4; |
138 | protocols |= PROT_UDPv4; |
140 | |
139 | |
141 | if (conf |
140 | if (conf->protocols & PROT_TCPv4 && conf->tcp_port) |
142 | && prot & PROTv4 |
|
|
143 | && conf->protocols & PROT_TCPv4 |
|
|
144 | && conf->tcp_port) |
|
|
145 | protocols |= PROT_TCPv4; |
141 | protocols |= PROT_TCPv4; |
146 | |
142 | |
147 | if (conf |
143 | if (conf->protocols & PROT_DNSv4 && conf->dns_port) |
148 | && prot & PROTv4 |
|
|
149 | && conf->protocols & PROT_DNSv4 |
|
|
150 | && conf->dns_port) |
|
|
151 | protocols |= PROT_DNSv4; |
144 | protocols |= PROT_DNSv4; |
|
|
145 | } |
152 | |
146 | |
153 | return protocols; |
147 | return protocols; |
154 | } |
148 | } |
155 | |
149 | |
156 | bool |
150 | bool |