patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9517, apps/sntp: Use ip_addr_copy to...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9517: apps/sntp: Use ip_addr_copy to save server address

Submitter:  Axel Lin <axellin>
Submitted:  Fri 15 Dec 2017 06:59:55 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Sun 17 Dec 2017 09:18:11 PM UTC, comment #1: 

Pushed, thanks for the patch!

Simon Goldschmidt <goldsimon>
Group administrator
Fri 15 Dec 2017 06:59:55 AM UTC, original submission:  

Use ip_addr_copy instead of ip_addr_set to avoid NULL test for
&sntp_last_server_address. This fixes build warning when
SNTP_CHECK_RESPONSE>=1 && LWIP_IPV4=1 && LWIP_IPV6=1.

In file included from ../../../../lwip/src/include/lwip/apps/sntp.h:41:0,
                 from ../../../../lwip/src/apps/sntp/sntp.c:52:
../../../../lwip/src/apps/sntp/sntp.c: In function ‘sntp_send_request’:
../../../../lwip/src/include/lwip/ip_addr.h:105:58: error: the comparison will always evaluate as ‘true’ for the address of ‘sntp_last_server_address’ will never be NULL [-Werror=address]
 #define IP_SET_TYPE(ipaddr, iptype)     do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr), iptype); }}while(0)
                                                          ^
../../../../lwip/src/include/lwip/ip_addr.h:157:36: note: in expansion of macro ‘IP_SET_TYPE’
 #define ip_addr_set(dest, src) do{ IP_SET_TYPE(dest, IP_GET_TYPE(src)); if(IP_IS_V6(src)){ \
                                    ^~~~~~~~~~~
../../../../lwip/src/apps/sntp/sntp.c:549:5: note: in expansion of macro ‘ip_addr_set’
     ip_addr_set(&sntp_last_server_address, server_addr);
     ^~~~~~~~~~~


Axel Lin <axellin>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by axellin (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-17 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2017-12-15 axellin Attached File- Added 0001-apps-sntp-Use-ip_addr_copy-to-save-server-address.patch, #42654

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code