Changeset 61bfc370 in mainline for uspace/srv/net/netif/lo/lo.c


Ignore:
Timestamp:
2011-01-07T18:57:55Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e08a733
Parents:
7c34b28f
Message:
  • make measured_string and other network-related data types binary-safe
  • fix several network-related routines binary-safe (replace clearly suspicious use of str_lcmp() with bcmp())
  • rename spawn() to net_spawn()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/netif/lo/lo.c

    r7c34b28f r61bfc370  
    5353
    5454/** Default hardware address. */
    55 #define DEFAULT_ADDR            "\0\0\0\0\0\0"
     55#define DEFAULT_ADDR  0
    5656
    5757/** Default address length. */
    58 #define DEFAULT_ADDR_LEN        (sizeof(DEFAULT_ADDR) / sizeof(char))
     58#define DEFAULT_ADDR_LEN  6
    5959
    6060/** Loopback module name. */
     
    6262
    6363/** Network interface global data. */
    64 netif_globals_t netif_globals;
     64netif_globals_t netif_globals;
    6565
    6666int netif_specific_message(ipc_callid_t callid, ipc_call_t *call,
     
    7474        if (!address)
    7575                return EBADMEM;
    76 
    77         address->value = str_dup(DEFAULT_ADDR);
     76       
     77        uint8_t *addr = (uint8_t *) malloc(DEFAULT_ADDR_LEN);
     78        memset(addr, DEFAULT_ADDR, DEFAULT_ADDR_LEN);
     79       
     80        address->value = addr;
    7881        address->length = DEFAULT_ADDR_LEN;
    79 
     82       
    8083        return EOK;
    8184}
Note: See TracChangeset for help on using the changeset viewer.