Changeset b1404f2 in rtems-libbsd


Ignore:
Timestamp:
Apr 30, 2018, 11:35:25 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
b96abfd647154f10ea8f7fac68e25676636eded5, 7f47f2784138109b8363804c2aecd3d83231ab0f, 089780d2de7014a9c451bbd54cd3bcc64b58dfc7, 66019c3e788605ff63f210a677abd5c8edfb0aa0
Children:
443a058
Parents:
ef5d536
git-author:
Sebastian Huber <sebastian.huber@…> (04/30/18 11:35:25)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/30/18 11:42:18)
Message:

Add DHCP clientid to test default network init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuite/include/rtems/bsd/test/default-network-init.h

    ref5d536 rb1404f2  
    130130default_network_dhcpcd_task(rtems_task_argument arg)
    131131{
     132        static const char default_cfg[] = "clientid libbsd test client\n";
    132133        int exit_code;
    133134        char *dhcpcd[] = {
     
    135136                NULL
    136137        };
    137 
    138         (void)arg;
    139 
    140 #ifdef DEFAULT_NETWORK_DHCPCD_NO_DHCP_DISCOVERY
    141         static const char cfg[] = "nodhcp\nnodhcp6\n";
    142138        int fd;
    143139        int rv;
    144140        ssize_t n;
    145141
     142        (void)arg;
     143
    146144        fd = open("/etc/dhcpcd.conf", O_CREAT | O_WRONLY,
    147145            S_IRWXU | S_IRWXG | S_IRWXO);
    148146        assert(fd >= 0);
    149147
    150         n = write(fd, cfg, sizeof(cfg));
    151         assert(n == (ssize_t) sizeof(cfg));
     148        n = write(fd, default_cfg, sizeof(default_cfg));
     149        assert(n == (ssize_t) sizeof(default_cfg));
     150
     151#ifdef DEFAULT_NETWORK_DHCPCD_NO_DHCP_DISCOVERY
     152        static const char nodhcp_cfg[] = "nodhcp\nnodhcp6\n";
     153
     154        n = write(fd, nodhcp_cfg, sizeof(nodhcp_cfg));
     155        assert(n == (ssize_t) sizeof(nodhcp_cfg));
     156#endif
    152157
    153158        rv = close(fd);
    154159        assert(rv == 0);
    155 #endif
    156160
    157161        exit_code = rtems_bsd_command_dhcpcd(RTEMS_BSD_ARGC(dhcpcd), dhcpcd);
Note: See TracChangeset for help on using the changeset viewer.