Acked-by: Sairam Venugopal <[email protected]>
On 12/13/16, 10:52 AM, "Alin Serdean" <[email protected]> wrote: >Checking for ERROR_INSUFFICIENT_BUFFER is incorrect per >MSFT documentation: >https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en >-2Dus_library_windows_desktop_aa365915-28v-3Dvs.85-29.aspx&d=DgICAg&c=uila >K90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=saWOLiw >2hhYRR-nDW2OSb-CDDqaeeOHF6HqdETLEQp4&s=w-oSMEuJM9I1cw5cvsjHBLFkuttr6pX_7eV >dLs-wM_8&e= > >Also, the initial call to GetAdaptersAddresses was wrong. In the case >of a successful return 'all_addr' was not allocated leading to a crash. > >Signed-off-by: Alin Gabriel Serdean <[email protected]> >Reported-by: Lior Baram <[email protected]> >--- > lib/netdev-windows.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/lib/netdev-windows.c b/lib/netdev-windows.c >index f5e809e..c2fbe42 100644 >--- a/lib/netdev-windows.c >+++ b/lib/netdev-windows.c >@@ -425,16 +425,16 @@ netdev_windows_get_next_hop(const struct in_addr >*host, > { > uint32_t ret_val = 0; > /* The buffer length of all addresses */ >- uint32_t buffer_length = 1000; >+ uint32_t buffer_length = 0; > PIP_ADAPTER_ADDRESSES all_addr = NULL; > PIP_ADAPTER_ADDRESSES cur_addr = NULL; > > ret_val = GetAdaptersAddresses(AF_INET, > GAA_FLAG_INCLUDE_PREFIX | > GAA_FLAG_INCLUDE_GATEWAYS, >- NULL, all_addr, &buffer_length); >+ NULL, NULL, &buffer_length); > >- if (ret_val != ERROR_INSUFFICIENT_BUFFER ) { >+ if (ret_val != ERROR_BUFFER_OVERFLOW ) { > VLOG_ERR("Call to GetAdaptersAddresses failed with error: %s", > ovs_format_message(ret_val)); > return ENXIO; >-- >2.10.2.windows.1 >_______________________________________________ >dev mailing list >[email protected] >https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_ >mailman_listinfo_ovs-2Ddev&d=DgICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5 >ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=saWOLiw2hhYRR-nDW2OSb-CDDqaeeOHF6HqdETL >EQp4&s=KKVliSW_g6NKJQXyZNk7hcNOoSAT5xwld5a77-RmzsI&e= _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
