Skip to content

ext/sockets: multicast simplification on ipv4 table retrieval and buf… #14542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions ext/sockets/multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ static int _php_source_op_to_ipv4_op(enum source_op sop)
zend_result php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
{
MIB_IPADDRTABLE *addr_table;
ULONG size;
DWORD retval;
ULONG size;
DWORD retval;
DWORD i;

(void) php_sock; /* not necessary */
Expand All @@ -635,8 +635,7 @@ zend_result php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struc
retry:
retval = GetIpAddrTable(addr_table, &size, 0);
if (retval == ERROR_INSUFFICIENT_BUFFER) {
efree(addr_table);
addr_table = emalloc(size);
erealloc(addr_table, size);
goto retry;
}
if (retval != NO_ERROR) {
Expand All @@ -662,8 +661,8 @@ zend_result php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struc
zend_result php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index)
{
MIB_IPADDRTABLE *addr_table;
ULONG size;
DWORD retval;
ULONG size;
DWORD retval;
DWORD i;

(void) php_sock; /* not necessary */
Expand All @@ -678,8 +677,7 @@ zend_result php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, uns
retry:
retval = GetIpAddrTable(addr_table, &size, 0);
if (retval == ERROR_INSUFFICIENT_BUFFER) {
efree(addr_table);
addr_table = emalloc(size);
erealloc(addr_table, size);
goto retry;
}
if (retval != NO_ERROR) {
Expand Down
Loading