Changeset b1404f2 in rtems-libbsd


Ignore:
Timestamp:
Apr 30, 2018, 11:35:25 AM (12 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
647dd08ae2aa69b935c2847ea450fb824322ecae, c6261f97870562d4c797cfb1ff1ba0affb85a916
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.